PHP 5.2 Upgrade - Login Page Not Working Now
Posted: Mon Aug 22, 2011 10:01 am
So while I was working on one project that required me to upgrade my PHP version to get Zen Cart installed, it looks like my other clients page is not working anymore.
I upgraded my language to PHP 5.2
This is hosted through GoDaddy.
There must be something that is not supported that I lost for this upgrade.
Here is my code that is not working.
Login.php
LoginAction.php
This has been working for over a year, and I think my PHP 5.2 upgrade over the weekend put the kibosh on it.
Any help is appreciated.
Thanks
I upgraded my language to PHP 5.2
This is hosted through GoDaddy.
There must be something that is not supported that I lost for this upgrade.
Here is my code that is not working.
Login.php
Code: Select all
<table width="1000" align="center">
<tr>
<td width="200" valign="top">
<form action="LoginAction.php" method="Post">
Email Address:<br />
<input type="Text" name="psEmail" />
<br />
Password:<br />
<input type="password" name="psPassword" />
<br />
<input type="submit" value="Login" />
<input type="hidden" name="psRefer" value="<? echo($refer) ?>"
</form>
</td>
<td>administration only</td>
</tr>
</table>Code: Select all
<?php
// Check if the information has been filled in
if($psEmail == '' || $psPassword == '') {
// No login information
header('Location: Login.php?refer='.urlencode($psRefer));
} else {
// Authenticate user
$hDB = mysql_connect('**SERVER**', '**DATABASE**', '**PASSWORD**');
mysql_select_db('**DATABASE**', $hDB);
$sQuery = "
Select iUser, MD5(UNIX_TIMESTAMP() + iUser + RAND(UNIX_TIMESTAMP())) sGUID
From tblUsers
Where sEmail = '$psEmail'
And sPassword = password('$psPassword')";
$hResult = mysql_query($sQuery, $hDB);
if(mysql_affected_rows($hDB)) {
$aResult = mysql_fetch_row($hResult);
// Update the user record
$sQuery = "
Update tblUsers
Set sGUID = '$aResult[1]'
Where iUser = $aResult[0]";
mysql_query($sQuery, $hDB);
// Set the cookie and redirect
setcookie("session_id", $aResult[1]);
if(!$psRefer) $psRefer = 'prep_admin.php';
header('Location: '.$psRefer);
} else {
// Not authenticated
header('Location: Login.php?refer='.urlencode($psRefer));
}
}
?>Any help is appreciated.
Thanks