I have checked for whitespace and anything other normal problems but don't see anything if there something else that might be causeing this? <head> <?php if (isset($_POST["basic"])) setcookie("basic","1",time()+3600); if (isset($_POST[full])) setcookie("full","1",time()+3600); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php if (isset($_POST["basic"])) echo "Basic Form from Post <br />"; elseif (isset($_COOKIE["basic"])) echo "Basic Form from COOKIE <br />"; else echo "No Basic Form <br />"; if (isset($_POST["full"])) echo "Full Form from Post <br />"; elseif (isset($_COOKIE["full"])) echo "Full Form from COOKIE <br />"; else echo "No Full Form <br />"; ?> </body> Code (markup):
Right there, the very first line reads :"<head>" You must not have any html code preceding your php script. Include your php cookie code in the first line of that file.
That's right, no output before a header is sent (cookies and session variables are part of the header info), you have 2 solutions : 1 - <?php if (isset($_POST["basic"])) setcookie("basic","1",time()+3600); if (isset($_POST[full])) setcookie("full","1",time()+3600); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Unt PHP: 2 - Use the OB function (OB : output buffer I think) <?php ob_start; ?> //anything here, PHP will not throw errors related to header info <?php ob_end_flush(); ?> PHP: