Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having issues creating login for website:


    mysql_connect($db_host, $db_username, $db_password) or die(mysql_error()); 
    mysql_select_db($db_database) or die(mysql_error());


    $username = stripslashes($username);
    $password = stripslashes($password);
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string($password);

    $sql="SELECT * FROM users WHERE username='$username' and password='$password'";

    if($count == 1) //ERROR APPEARS TO TAKE PLACE HERE
        $_SESSION['username'] = $username;
        $_SESSION['password'] = $password;
    else {

Neither the console nor log are catching any errors.

share|improve this question

closed as off topic by Michael Hampton, MadHatter, Scott Pack, Ladadadada, Sven Oct 29 '12 at 23:51

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 4 down vote accepted




header('Location: login_success.php');

Also, session_start() is a common source of errors, often due to permissions.

Turn on error reporting with:

ini_set('display_errors', 1);
share|improve this answer

set display_errors=on in your php.ini. That way you can check what is wrong with your script.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.