Jump to content

Login Help


White_Lily

Recommended Posts

Hi, I have a problem in which I have validation that allows a user to sign into their account if they didn't provide an email address upon registration (which when they do provide an email address they get sent a generated password in their welcome email).

 

Once they manage to sign in without the password they will get directed to a page where they will be asked to create one.

 

However when this process happens it does not log them in, it just comes up with an Internal Server Error.

 

My code is below:

 

if(!empty($_POST["login"])){
$logUser = $_POST["logUser"]; $logPass = $_POST["logPass"];

if(empty($logUser)){
$logErr .= "<li class='error'>You can't sign in without providing your registered username.</li>";
}
$grabUserData = select("username, password", "users", "username = '$logUser'");
$data = mysql_fetch_assoc($grabUserData);

if($data["username"] != $logUser){
$logErr .= "<li class='error'>Invalid username</li>";
}
if(empty($logPass) && $data["password"] == "da39a3ee5e6b4b0d3255bfef95601890afd80709"){
session_start();
$_SESSION["UserProfile"] = $logUser;
$_SESSION["UserID"] = $data["user_id"];
header("profile.php");
}
}

 

Any ideas would be useful.

 

- Lily

 

(I don't want posts about the security of my processing code... if I wanted opinions on this I would ask.)

Link to comment
https://forums.phpfreaks.com/topic/271589-login-help/
Share on other sites

If you are getting a HTTP 500 Internal Server Error on a .php page it usually means that you are getting a fatal parse or a fatal runtime error.

 

You should be developing and debugging your code with php's error_reporting set to E_ALL and display_errors set to ON, so that php will report and display all the errors it detects.

 

The snippet of posted code doesn't produce a fatal parse error.

 

We cannot possibly help you with a HTTP 500 Internal Server Error without A) the code for the entire page, including any included/required files (less any database connection information) and B) the php detected errors on the page.

Link to comment
https://forums.phpfreaks.com/topic/271589-login-help/#findComment-1397465
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.