page update after cookie is set?
Posted: Thu Feb 05, 2004 10:11 am
here is my code... the page redircts to the main page with javascript 2 seconds after the cookie is set. but the main page doesn't update with the info in the cookie, I have to manually refresh the page for it to update...
try it yourself:
http://casuga.sytes.net/
try it yourself:
http://casuga.sytes.net/
Code: Select all
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function redirTimer()
{
self.setTimeout("self.location.href = 'http://www.irissystems-inc.com/casuga/default.php';","2000");
}
// End -->
</script>
<body onLoad="redirTimer()">
<?php
if ($_POSTї"password"]=="casphy1024")
{
echo "Logged in";
echo setcookie("loggedin", "1", time() + 60*60*24);
}
else
echo "<div class='error'>Invalid password</div>";
?>
</body>