Forms Help Password and Confirm Password
Thanks for all your help in my previous questions. I have yet anothe开发者_如何学Pythonr question that I needed help with.
I have developed a form and have two fields called password and confirm password. How do i make sure that Password and confirm password are equal? If they aren't I need to display a message.
Thank You
@richsage - Thanks. I will from now on.
Thank you everyone..
Parameters to a PHP script are always strings, so you can use the equality operator (==
) to check if the two parameters have the same value.
<?php
if ($_GET["password"] != $_GET["confirm_password"]){
echo "Passwords must match";
}else {
// do something
}
Use strcasecmp()
or strncasecmp()
function
精彩评论