I have a session login stript that is sending me to scripts that return a blank page. No errors, just a blank page.
Now here is the really strange part (to me). If I hit view source, the source shows all the tags for a header and a simple message and two links. But none of that displays. Even the page header title doesnt show.
The PHP pages it links to, x_management_main.php and x_management_logout.php are both totally blank. There is no error, there is just nothing on the page.
I know that logout is logging out the user, from using the login page (it knows when Im logged in and when it says I am, I go to logout and it allows me to login again).
Here is the main login script, which calls itself (successfully):
<? session_start() ?>
<HTML>
<HEAD>
<TITLE>Roster Management Login</TITLE>
</HEAD>
<BODY>
<H2 align="center">Roster Management Login</H2>
<div align="center">
<?
$links="<A HREF='x_management_main.php'>Click here to proceed to the main Roster Management page.</A><BR><BR>";
$links.="<A HREF='x_management_logout.php'>Click here to log out.</A>";
if ($fuser && $fpass) {
if ($logged_in_user==$fuser) {
echo $fuser.", you are already logged in.<BR><BR>";
echo $links;
exit;
}
$db=mysql_connect("xxxx", "xxxx", "xxxx");
mysql_select_db("xxxx", $db) or die ("<H3>database not existent</H3>");
$result=mysql_query("SELECT * FROM `users` WHERE userslo = '".$fuser."' AND passwordslo = '".$fpass."'");
if (!$result) {
echo "Cannot Retrieve that Data.";
exit;
}
if (mysql_num_rows($result) > 0) {
$logged_in_user=$fuser;
session_register("logged_in_user");
echo "Welcome, ".$logged_in_user.".<BR><BR>";
echo $links;
exit;
} else {
echo "Invalid login. Please try again. <BR><BR>";
}
} else if ($fuser || $fpass) {
echo "Please fill in both fields.<BR><BR>";
}
?>
<FORM METHOD=POST ACTION="x_management_login.php">
Username:
<INPUT NAME="fuser" TYPE=TEXT MAXLENGTH=20 SIZE=20>
<BR>
Password:
<INPUT NAME="fpass" TYPE=PASSWORD MAXLENGTH=20 SIZE=20>
<BR>
<INPUT TYPE=SUBMIT VALUE="Login">
</div>
</FORM>
</BODY>
</HTML>
Here are the PHP for the main page:
<? session_start() ?>
<HTML>
<HEAD>
<TITLE>Main Roster Management</HTML>
</HEAD>
<BODY>
<H2>Main Roster Management</H2>
<BR>
<?
if (!$logged_in_user) {
echo "<H3>Whoops!</H3><BR>";
echo "Your not logged in. No shirt, no shoes... It's like that.<BR>";
echo "<A HREF='x_management_login.php'>Please click here to login.</A>";
exit;
}
echo "Welcome, ".$logged_in_user.".";
?>
This is the main page. Exciting, isn't it.
<BR>
<BR>
<A HREF="x_management_logout.php">Click here to log out.</A>
</BODY>
</HTML>
Here are the PHP for the logout page:
<? session_start() ?>
<HTML>
<HEAD>
<TITLE>Roster Management Logout</HTML>
</HEAD>
<BODY>
<H2>Roster Management Logout</H2>
<?
if($logged_in_user) {
session_unregister("logged_in_user");
echo "You are now logged out.";
} else {
echo "You haven't even logged in yet.";
}
?>
<BR>
<BR>
<A HREF="x_management_login.php">Click here to log in.</A>
</BODY>
</HTML>
Both yields a page that is totally blank. However, this is the "view source" of the pages:
Main:
<HTML>
<HEAD>
<TITLE>Main Roster Management</HTML>
</HEAD>
<BODY>
<H2>Main Roster Management</H2>
<BR>
Welcome, jk.This is the main page. Exciting, isn't it.
<BR>
<BR>
<A HREF="x_management_logout.php">Click here to log out.</A>
</BODY>
</HTML>
Logout:
<HTML>
<HEAD>
<TITLE>Roster Management Logout</HTML>
</HEAD>
<BODY>
<H2>Roster Management Logout</H2>
You are now logged out.<BR>
<BR>
<A HREF="x_management_login.php">Click here to log in.</A>
</BODY>
</HTML>
I am thinking its something to do with the session?