Ok, in index.php I have this:
require("../includes/functions.inc");
in functions.inc I have this:
function login_info() {
if ($phphreak_pass != "") {
echo "You are logged in as: <b>$phphreak_user</b>.<br>\n
Click <a class=\"headlinks\" href=\"/logout.php\">here</a> to log out.";
} else {
echo "
$phphreak_pass
<form name=\"login\" action=\"\login.php\" method=\"post\">
Please <a class=\"headlinks\" href=\"/register.php\">register</a> or login:<br>\n
Username: <input type=\"text\" name=\"username\"><br>
Password: <input type=\"password\" name=\"password\"><br>
<input type=\"hidden\" name=\"login\" value=\"yes\">
<a class=\"headlinks\" href=\"javascript:document.login.submit()\">Login</a>
</form>
\n";
}
}
I have set the cookies already in a different script (login.php), and I have tested "echo $phphreak_pass" in index.php without using the include file and it prints the cookie successfully. So, how can I get the value of the cookie, so that I can test it in the if() statement?..
I have tried doing something like this:
$phphreak_pass = $HTTP_COOKIE_VARS["phphreak_pass"];
and it still won't work.
Any suggestions?
Thanks,
Chris Edwards
Co-Founder
PocketMatrix.com