Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to save sessions but it doesn't. After refreshing it just disappears just like a post.

This is my script

if(isset($submitlogin)){
    //Query setup
    $loginquery = "SELECT 
                    UserID, 
                    Password 
                FROM 
                    Login 
                WHERE 
                    UserID='".mssql_real_escape_string($username)."' AND 
                    Password='".$password."'";
    $loginresult = mssql_query($loginquery);
    $countrows = mssql_num_rows($loginresult);

    if($countrows == 1){
        $_SESSION['username'] = $username;
        $_SESSION['password'] = $password;

    }
    if($countrows != 1){
        $login .= "<span style='color:red'>Login Failed</span>";
    }
}

It does work on my laptop, where I do not use appserv. Does anyone know the solution?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.