Jump to content

PHP Cookies


anonymopt

Recommended Posts

im creating an adult website and i wanted that the first page asks the users to press "yes" if they are over 18 and "no" if they are under.

 

the cookie was to remeber the user choice... so if the user pressed yes he would never be asked again if he was 18.

 

I tried this using cookies but with no sucess.. can soemone suggest me the code?

Link to comment
https://forums.phpfreaks.com/topic/153224-php-cookies/
Share on other sites

<?

  $x = $_COOKIE["visitabuddy"];

  if($x == "Adult")

  {

  echo "<script language='javascript'>

            var d = document;

            d.location.href='http://pornbuddy.org/blog/';

            </script>

            ";

 

  }

  else

  {

  echo ""

    }

?>

 

and on the other page...

 

<?

$inTwoMonths = 60 * 60 * 24 * 30 + time();

setcookie('visitabuddy', 'Adult', $inTwoMonths,'/','pornbuddy.org');

?>

 

but it doesnt work in IE 7 only on firefox

 

Link to comment
https://forums.phpfreaks.com/topic/153224-php-cookies/#findComment-804946
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.