Not working for me...
PHP 4.0.6 ($_COOKIE[] is unsupported in this version)
$dir_to_noncgi = "../ubb";
require "$dir_to_noncgi/vars_config.inc.php";
global $Cookie_Number, $CGIURL;
$my_cookie = $HTTP_COOKIE_VARS['ubber'.$Cookie_Number];
$my_ubb = "$CGIURL/ultimatebb.cgi";
if ($my_cookie) { $take_me_apart = explode("&", $my_cookie);
$username = $take_me_apart["2"];
echo "Hello $username! [ <a href="$my_ubb?ubb=logout">Logout</a> ]";
} else {
echo "You are not logged in [ <a href="" . $my_ubb . "?ubb=login">Login</a> or <a href="" . $my_ubb . "?ubb=agree">Register</a> ]";
}
The javascript version works, but I need the PHP version to work because I need to know whether they're logged in BEFORE they can view the page (security reasons.)
Thanks for any help