Cookied are not stored
Hi.
Below is a simple form
<?php
if ((((isset($_POST["rememberme"]))?$_POST["rememberme"]:"") != "")) {
setcookie("uname", "".((isset($_POST["mem_mail"]))?$_POST["mem_mail"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}?>
<?php
if ((((isset($_POST["rememberme"]))?$_POST["rememberme"]:"") != "")) {
setcookie("password", "".((isset($_POST["mem_pwd"]))?$_POST["mem_pwd"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}?>
<?php
if ((((isset($_POST["rememberme"]))?$_POST["rememberme"]:"") != "")) {
setcookie("remember", "1", time()+(60*60*24*30), "/", "", 0);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Login form</title>
</head>
<body>
<form id="frm_login" name="frm_login" method="post" action="logged.php">
<p>
<label for="mem_mail">Email:</label>
<input name="mem_mail" type="text" id="mem_mail" value="<?php echo((isset($_COOKIE["uname"]))?$_COOKIE["uname"]:"") ?>">
</p>
<p>
<label for="mem_pwd">Password:</label>
<input name="mem_pwd" type="text" id="mem_pwd" value="<?php echo((isset($_COOKIE["password"]))?$_COOKIE["password"]:"") ?>">
</p>
<p>
<input <?php if (!(strcmp($_COOKIE['remember'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="rememberme" id="rememberme">
<label for="rememberme">Remember Me</label>
</p>
<p> </p>
<p>
<input type="submit" name="submit" id="submit" value="Submit">
</p>
</form>
</body>
</html>
Unfortunately the cookies are not stored.
Can someone tell me what is wrong please?
Thanks.