Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Error logging in. The username or password does not match (http://www.go4expert.com/forums/error-logging-username-password-match-t28236/)

abosirage 19Apr2012 17:47

Error logging in. The username or password does not match
hi everybody
here I am again with new problem because I am sure will get solution, I get very wonderful script for logging uploaded in my site http://islamicbank.ly/test/cars/fass/ as test it work for registration & write to database & send email with confirm code & confirm registration but when I try to login I am facing with this massage:
Error logging in. The username or password does not match
I attached files used in my case

here is my login page
HTML Code:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
      <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
      <link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" />
      <script type='text/javascript' src='scripts/gen_validatorv31.js'></script>

<!-- Form Code Start -->
<div id='fg_membersite'>
<form id='login' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
<fieldset >

<input type='hidden' name='submitted' id='submitted' value='1'/>

<div class='short_explanation'>* required fields</div>

<div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
<div class='container'>
    <label for='username' >UserName*:</label><br/>
    <input type='text' name='username' id='username' value='<?php echo $fgmembersite->SafeDisplay('username') ?>' maxlength="50" /><br/>
    <span id='login_username_errorloc' class='error'></span>
<div class='container'>
    <label for='password' >Password*:</label><br/>
    <input type='password' name='password' id='password' maxlength="50" /><br/>
    <span id='login_password_errorloc' class='error'></span>

<div class='container'>
    <input type='submit' name='Submit' value='Submit' />
<div class='short_explanation'><a href='reset-pwd-req.php'>Forgot Password?</a></div>
<!-- client-side Form Validations:
Uses the excellent form validation script from JavaScript-coder.com-->

<script type='text/javascript'>
// <![CDATA[

    var frmvalidator  = new Validator("login");

    frmvalidator.addValidation("username","req","Please provide your username");
    frmvalidator.addValidation("password","req","Please provide the password");

// ]]>

Form Code End (see html-form-guide.com for more info.)


& this is my membersite_config.php

HTML Code:


$fgmembersite = new FGMembersite();
SetWebsiteName('موقع الصيرفة الاسلامية');

                      /*database name*/'islamicb_car',
                      /*table name*/'login');



& this the part concerning in my fg_membersite.php page
HTML Code:

function GetLoginSessionVar()
        $retvar = md5($this->rand_key);
        $retvar = 'usr_'.substr($retvar,0,10);
        return $retvar;
    function CheckLoginInDB($username,$password)
            $this->HandleError("Database login failed!");
            return false;
        $username = $this->SanitizeForSQL($username);
        $pwdmd5 = md5($password);
        $qry = "Select name, email from $this->tablename where username='$username' and password='$pwdmd5' and confirmcode='y'";
        $result = mysql_query($qry,$this->connection);
        if(!$result || mysql_num_rows($result) <= 0)
HandleError("Error logging in. The username or password does not match");
            return false;
        $row = mysql_fetch_assoc($result);
        $_SESSION['name_of_user']  = $row['name'];
        $_SESSION['email_of_user'] = $row['email'];
        return true;

badly need for your help

please help me

smohd 23Aug2012 11:49

Re: Error logging in. The username or password does not match
So looks like the query returns 0 result,
Lets start looking at your code:
First are you sure that this condition is true for your user:

Also did you use md5 to encrypt the password in registration?

All times are GMT +5.5. The time now is 10:08.