+ Reply to Thread
Results 1 to 3 of 3
Like Tree2Likes
  • 1 Post By sikuneh
  • 1 Post By manishmca200819

Thread: Login gives "500 Internal Server Error"

  1. #1
    sikuneh is offline x10Hosting Member sikuneh is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    43

    Login gives "500 Internal Server Error"

    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 Code:
    <?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 by sikuneh; 08-07-2011 at 08:03 PM.
    dinomirt96 likes this.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Login gives "500 Internal Server Error"

    You may also wish to add a call to session_regenerate_id after successful login to prevent session fixation.

    Is there a call to session_start that's not shown in the sample?
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    manishmca200819 is offline x10Hosting Member manishmca200819 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    1

    Re: Login gives "500 Internal Server Error"

    You can remove htacces and it will work.
    karimirt47 likes this.

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 05-14-2011, 12:17 PM
  2. Replies: 0
    Last Post: 03-03-2011, 04:18 PM
  3. Replies: 0
    Last Post: 09-11-2010, 11:20 AM
  4. Replies: 2
    Last Post: 08-05-2010, 01:22 PM
  5. "Internal Server Error" on my Joomla installation
    By trot_7 in forum Free Hosting
    Replies: 1
    Last Post: 09-08-2007, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers