I've got a script that has an area where you login. The script also has an installation script, during which you set the admin login and password. After the admin runs the installation script, they go to login. The following bit of code is where the script redirects the admin if their password matches their login:
if($submit)
{
include("config.php");
include ($databasepath."/dbconfig.php");
$result = mysql_query("SELECT password,penname,uid,userskin,level FROM fanfiction_authors WHERE penname='$penname'");
$passwd = mysql_fetch_array($result);
$encryptedpassword = md5($password);
if($passwd[password] == $encryptedpassword)
{
$_SESSION['loggedin'] = 1;
$_SESSION['penname'] = "$passwd[penname]";
$_SESSION['uid'] = "$passwd[uid]";
$_SESSION['userskin'] = "$passwd[userskin]";
if($passwd[level] != 0)
{
$_SESSION['level'] = "$passwd[level]";
$_SESSION['adminloggedin'] = 1;
}
header("Location: user.php");
}
Here's the weird thing: the very first time that the admin logs in, they get a blank white screen. This is only for the first time that they login, after running the installation script. All future times they login, the logging in works fine. This is positively driving me insane, because it's only happening that first time, which makes no sense, because all future logins are using the same exact section of code to login. So why is it working all the other times, but not the first time?? Any ideas?