hmmmm... I am doing it a bit differently. I want to create a table on the front index.php that gives them the:
Hello Username [ Logout ]
If they are logged in. If they aren't logged in, I want to give them a login box. That part is easy, except that it's never recognizing me as being logged in. You can see the results on the front page here, lower right hand corner.
Here's my code:
<?
// Name: Name on front page by raiyan
// Description: Grabs your ubb name and prints it
// change this!!!
$dir_to_noncgi = "/home/virtual/admin35/var/www/html/ubb";
// change this!!!
require "$dir_to_noncgi/vars_config.inc.php";
global $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $Cookie_Number, $CGIURL;
$my_cookie = $_COOKIE["ubber$Cookie_Number"];
$my_ubb = "$CGIURL/ultimatebb.cgi";
if ($my_cookie) {
$cookie = explode("&", $my_cookie);
echo "Hello $cookie[2]! [ <a href="$my_ubb?ubb=logout">Logout</a> ]";
} else {
echo "<form action="$CGIURL/ultimatebb.cgi" method="post">
<input type="hidden" name="ubb" value="do_login" />
Login Name: <input type="text" name="username" size="15" maxlength="40" />
Password: <input type="password" name="password" size="15" maxlength="30" />
<input type="submit" name="submit" value="Login" /></form>";
}
?>
Any ideas why it's not recognizing me as being logged in?