Jump to content


Photo

Verifying Same Passwords on Register


  • Please log in to reply
2 replies to this topic

#1 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 21 June 2006 - 01:33 AM

Im kinda new to the entire php programming thing and was wondering what commands line(s) i would use to make sure that when someone enters in a password to reg they enter it twice and then the php script verifies that the 2 passwords are the same.

Any help is appreciated.

#2 realjumper

realjumper
  • Members
  • PipPipPip
  • Advanced Member
  • 399 posts

Posted 21 June 2006 - 01:50 AM

I think the following is correct but I haven't tested it.....

<?php 
if (isset($_POST['submit'])) 
{ 
$password = $_POST["password"];
$cpassword = $_POST["cpassword"];

//Do the passwords match?
if($password!==$cpassword) 
{

echo "Passwords do not match";
exit();
}

else
{
echo "Passwords match - yipee "; 
}
}
?>

<form action="" method="POST" name="form1">

Password : <input type="password" size="30" maxlength="40" name="password">
Confirm Password <input type="password" size="30" maxlength="40" name="cpassword">
<input type="submit" value="Submit">

</form>


#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 01:53 AM

[!--quoteo(post=386227:date=Jun 21 2006, 01:33 AM:name=cameeob2003)--][div class=\'quotetop\']QUOTE(cameeob2003 @ Jun 21 2006, 01:33 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Im kinda new to the entire php programming thing and was wondering what commands line(s) i would use to make sure that when someone enters in a password to reg they enter it twice and then the php script verifies that the 2 passwords are the same.

Any help is appreciated.
[/quote]

dont know if that helps as i am learning aswell
<?

if(!$first_password==$secound_password) {

do somethink

}else{

echo " sorry first and secound password must match";

}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users