Jump to content

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.)

Edited by White_Lily
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.

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

If they are the same, then please explain why enabling the php.ini file does not display errors on one Internal Server Error, whereas HTTP 500 does display errors?

I know what die; does, im just saying that I don't usually need it.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.