cookies and php - basics

From: deko (dje422_at_hotmail.com)
Date: 03/22/04


Date: Mon, 22 Mar 2004 07:02:23 GMT

This is about the simplest example I could come up with, but for some reason
(not my browser's settings) it's not working...

[top of page]
<?php
setcookie($cookie_name, "cookie_content", time()+3600);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>cookie test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>
<?php
if (isset($cookie_name))
{
 print "Welcome! <br>";
}
 else
{
 print "Go away.";
}
?>
</p>
</body>
</html>

Am I missing something? thx



Relevant Pages