Original Post
My site needs rewriting, so every now and then I add a little to it. I am doing my login screen now but for some reason I cannot write my cookie. After looking up the code on the PHP site I found out that I need to write my cookie before sending the HTML headers. So, this is my code now:
-Earth is 98% full. Please delete anybody you can.
// Function definitions and require_once() calls
// Begin normal script execution, by grabbing action and the username/password
$action = $_POST["action"];
$username = $_POST["username"];
$password = $_POST["password"];
// Write cookie with username/password
WriteCookie($username, $password);
?>
<!-- Send HTML headers -->
<html>
<header>
<title>
</title>
</header>
<body>
<!-- End HTML headers -->
<?php
if ($action == "login")
Login($username, $password);
else
ShowLogin();
?>
The code for WriteCookie is this:
function WriteCookie($User, $Pass)
{
$Array = array($User, $Pass);
$CookieText = implode(":", $Array);
$Ret = setcookie("ToolmakerSoft", $CookieText, time()+36000);
return $Ret;
}
Why doesn''t my cookie get written?
Toolmaker
-Earth is 98% full. Please delete anybody you can.
