i am getting this error when running my script:
Warning: Cannot modify header information - headers already sent by (output started at D:Program Fileswampwwwtrainingindex.php:4) in D:Program Fileswampwwwtrainingindex.php on line 11
here is the code:
[code]<?php
if (!isset($_COOKIE[‘mycookiename’]))
{
echo “No cookie present, making cookie”;
//Get the current time and make the cookie
$time = time();
$username = "anton";
$password = "pass";
$cookie_data = $username.'-'.$password;
if (setcookie ("mycookiename",$cookie_data, $time+3600)==TRUE)
{}
else
{
echo "Your computer does not support cookies.";
exit();
}
}
//Use cookie and Extract the cookie data (Username and Password)
$cookie_info = explode('-', $_COOKIE['mycookiename']);
$namecookie = $cookie_info[0];
$passcookie = $cookie_info[1];
echo "Username: $namecookie<br>Password: $passcookie";
?>[/code]