Jump to content

simple if..


pgrevents

Recommended Posts

Its simple i know but i cannot see the errors of my ways. I am creating a sign up form and I am passing the details via ajax. I know that both variables are sending and getting picked up by the script but its returning false info.

 

Basicly its a validation to check if the user has confirmed their password correctly.

 

here is the code

 

<?php
$pass = $_POST['pword'];
$check = $_POST['check_pass'];
if ($pass == $check)
{
echo "yes";
}

else 
{
echo "no";
}
?>

 

i been staring at this machine all day thats prob why i cant see the error :0 any help??

Link to comment
https://forums.phpfreaks.com/topic/159413-simple-if/
Share on other sites

<?php
$pass = $_POST['pword'];
$check = $_POST['check_pass'];
if (($pass == $check) && (strlen($pass)) {
echo "yes";
} else {
echo "no";
}
?>

 

this would be a tad more secure, however, there is no error in ur php..

 

I think you're sending them as the wrong names you're expecting

Link to comment
https://forums.phpfreaks.com/topic/159413-simple-if/#findComment-840906
Share on other sites

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.