Login gives "500 Internal Server Error"

sikuneh

New Member
Messages
55
Reaction score
0
Points
0
I'm not sure if this is the right place, but when I submit my login form and it goes to the page to validate I always get a "500 internal server error." Everything else seems to work just fine.

Validation form
PHP:
<?PHP
// validate.php
// Validate user input and login

// include form_data class
include("scripts/form_data.class.php");

$form_data = new form_data();
$vars = array('username' => $_POST['username'],
			'password' => $_POST['password']);
$errors = array();

$errors = $form_data->check_empty($vars,$errors);											// Check for empty
$vars['password'] = $form_data->hash_password("SHA256",$vars['password']);					// Hash password for security

$errors = $form_data->check_valid_login($dbh,$vars['username'],$vars['password'],$errors);	// Check for valid login

// If there were errors with the form
// format and display them
if($errors)
{
	$form_data->user_errors($errors);
}
else
{
	try
	{
		$_SESSION['user_login'] = $vars['username'];
		$user_ID = get_ID($dbh,$vars['username']);
		$perms = $form_data->get_permissions($dbh,$user_ID);
		$_SESSION['user_permission'] = $perms;
	
		header("Location:index.php");
	}
	catch(PDOException $error)
	{
		record_error("users/validate.php",$error->getMessage(),"Cannot log you in",uniqid());
	}
}
?>

It works fine on my local server. Can someone help me.

Edit01: Fixed
 
Last edited:
Top