Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Adults Warning
guzer
post 22.02.2012, 20:04:41
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 16.02.2012

Ostrzeżenie: (0%)
-----


Witam

mam stronke napisaną w php i potrzebuje zrobić coś takiego jak adults warning przed wejsciem na strone, tak by akceptacja zapisywala sie w ciasteczkach do 1 sesji przegladarki

mam takie cos

Robię stronę check-it.php

  1. CODE
  2. <?
  3. //Check user agent
  4. $r_explorer = $_SERVER [ 'HTTP_USER_AGENT' ];
  5. if ( ( substr_count ( $r_explorer , 'bot' )== 0 ) and ( substr_count ( $r_explorer , 'yahoo' )== 0 ) and ( $_COOKIE [ 'warning1' ]!= 21 ) ) {
  6. include 'warning-page.php' ;
  7. }
  8. ?>



W index.php strony dla strony głównej dodaje :
  1. CODE
  2. <? include 'check-it.php' ; ?>


Tworzę również warning-page.php
  1. CODE
  2. <?
  3. //Lets Set the cookie
  4. if ( $_GET [ 'myage' ]== "I-Am-Older-Than-18" ) {
  5. $page1 = $_GET [ 'page1' ];
  6. setcookie ( "warning1" , 21 , time ()+ 7200 );
  7. header ( 'Location:' . urldecode ( $page1 )) or die( '<a href="' . urldecode ( $page1 ). '"></a>' );
  8. }
  9. ?>
  10. <!--Now the Html Part- Remove this line please-->
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  14. <title>ADULT CONTENT WARNING</title>
  15. <link href="mystyle.css" rel="stylesheet" type="text/css">
  16. </head>
  17. <body bgcolor="#000000" style="margin:0px;">
  18. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;height:100%;">
  19. <tr>
  20. <td align="center">
  21. <p><b><font color="#FFFF66" face="Verdana, Arial, Helvetica, sans-serif" size="3">Adult Content Warning !
  22. <br>
  23. <img src="warning.png" width="240" height="80"> <br>
  24. </font></b><br>
  25. <h2>
  26. <a href="warning-page.php?myage=I-Am-Older-Than-18&page1= <?=urlencode ( $_SERVER [ 'REQUEST_URI' ]) ?> "><font style="font-size:20px; font-family:'Verdana '; color:red"><b>Click Here if You are older than 18 Years Old</b></font><br>
  27. </a><br>
  28. <a href="http://www.someothersite.com">Click Here to Leave </a></p>
  29. </td>
  30. </tr>
  31. </table></body></html>

Mam 3 problemy

1. Nie zapisuje mi ciasteczek na 1 sesje
2. Akceptacja jest dziala ale moge przewinąc stronę w dół i widze zawartość strony
3. Napisy o akceptacji jak dam, nie wyswietlaja polskiej czcionki

Bardzo proszę o pomoc

dzieki exclamation.gif

Ten post edytował guzer 22.02.2012, 20:37:03
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.06.2025 - 04:31