I'm trying to write a cookie loader for this forum I'm recoding (it was written by me in ASP, and im re-doing it in PHP/mysql -- blizzforums.com) and it keeps saying that the index is undefined wherever i mention $HTTP_COOKIE_VARS[$cook_username] and cook_password. Here is the code, maybe someone can give me some insight on this...
<?php
$cook_username = 'bf_username';
$cook_password = 'bf_password';
function loadCookies()
{
global $cook_username, $cook_password, $username, $password, $HTTP_COOKIE_VARS;
if( isset($HTTP_COOKIE_VARS[$cook_username]) )
{
$password = $HTTP_COOKIE_VARS[$cook_password];
$username = (isset($HTTP_COOKIE_VARS[$cook_username]) && $HTTP_COOKIE_VARS[$cook_username] != "") ? $HTTP_COOKIE_VARS[$cook_username] : 'Guest';
} else {
setCookie($cook_username);
setCookie($cook_username, '', time() - 3600);
setCookie($cook_password);
setCookie($cook_password, '', time() - 3600);
$password = '';
$username = 'Guest';
}
}
function loadClick()
{
global $HTTP_COOKIE_VARS, $HTTP_REFERER, $REQUEST_URI, $REMOTE_ADDR, $username, $password;
if( !$HTTP_REFERER ) { $referer = "None"; } else { $referer = $HTTP_REFERER; }
if( !$REQUEST_URI ) { $uri = "None"; } else { $uri = $REQUEST_URI; }
}
loadCookies();
?>