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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.