Cookie named 'user' is not set!
Code:
<?php
$cookie_name = "user";
$cookie_value = "John Doe";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
?>
<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<div class="topbar">
<?php
include 'navbar.php';
?>
</div>
<?php
//make a cookie withg username
//greet user with name
if(!isset($_COOKIE[$cookie_name]))
{
echo "Cookie named '" . $cookie_name . "' is not set!";
}
else
{
echo 'Hello, '. $_COOKIE[$cookie_name].'!';
}
echo '<br>';
echo '<br>';
echo '<br>';
?>
<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex050.php");
?>
</div>
</body>
</html>