Code: Select all
<?php
setcookie( "vegetable","artichoke", time()+3600,"/", ".yourdomain.com",0);
$display_block = $_COOKIE["vegetable"];
?>
<html>
<head>
<title>Secret Page</title>
</head>
<body>
<?php echo "$display_block"; ?>
</body>
</html>and I get the following error:
Notice: Undefined index: vegetable in C:\Program Files\Apache Group\Apache2\htdocs\working\Exercises\login\testcookie.php on line 4
I have got cookies enabled,
What is my problem - can anyone help?
Julia