Jump to content

MemberRef and password check


Cyberspace

Recommended Posts

I am trying to validate a MemberRef and password, im want to check that a MemberRef and password in a table called "members" exists and then also that they match. Can anyone help?

 

I have the following code:

 

<?php


if (isset($_POST['submit'])) {  

$MemberRef_message = ''; 
$Password_message = '';


$MemberRef = mysql_real_escape_string(stripslashes($_POST['MemberRef']));
$Password = mysql_real_escape_string(stripslashes($_POST['Password']));


$account = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE MemberNo='$MemberRef' && Password='$Password'"));    


}




<hr class="hr_blue"/></p><font face="Arial" size="3">Join Walk</font><form method="post" class="addwalkerform" action="">   
</font>
<fieldset>
<label for="MemberRef">MemberRef:</label>  
<input readonly name="MemberRef" type="text" id="MemberRef"/><br />  
</fieldset><p></p>

<fieldset>
<label for="username">Password:</label>  
<input readonly name="username" type="text" id="username" value="<?php echo $_SESSION["username"]; ?>" /><br />  
</fieldset><p></p>

<fieldset> 
<p class="submit"> 
   <input type="submit" name="submit" value="Join Walk" /> 
</p> 
</fieldset

</fieldset>
</form>

<?php
}
?>

Link to comment
https://forums.phpfreaks.com/topic/100231-memberref-and-password-check/
Share on other sites


if (isset($_POST['submit'])) {  

    $MemberRef_message = ''; 
    $Password_message = '';

    $MemberRef = mysql_real_escape_string(stripslashes($_POST['MemberRef']));
    $Password = mysql_real_escape_string(stripslashes($_POST['Password']));


    $account = mysql_query("SELECT * FROM members WHERE MemberNo='$MemberRef' &&   Password='$Password'"));

    if(mysql_num_rows($account) == 0){
        echo "Wrong"
    } else {

    }

 

There is no name="Password" in your form either!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.