Forum Moderators: coopster
page1
-----------
<?php
setcookie("uname", $name, time()+36000);
?>
page2
-----------
<?php
if (isset($_COOKIE["uname"]))
echo "Welcome " . $_COOKIE["uname"] . "!<br />";
else
echo "You are not logged in!<br />";
?>
I always get "you are not logged in!" though. I tried on opera and IE6. And for PHP I'm using AppServ.
What is going wrong?!?! I'm pulling my hair out!
no space! before the "<?php"
If php gets any space it will send the header without your cookie request..... at least thats how I understand it!
Hope that helps!