开发者

Forms Help Password and Confirm Password

开发者 https://www.devze.com 2023-01-19 06:58 出处:网络
Thanks for all your help in my previous questions. I have yet anothe开发者_如何学Pythonr question that I needed help with.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消