tags:

views:

37

answers:

3

Hey guys,

Thanks for all your help in my previous questions. I have yet another 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..

A: 

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.

Ignacio Vazquez-Abrams
A: 

Use strcasecmp() or strncasecmp() function

ivan73
Do you really believe that passwords should be case-insensitive?
Ignacio Vazquez-Abrams
Hi, Ingacio. It's up to developer, this is why I posted both functions. Passwords shouldn't be case-insensitive.
ivan73
A: 
<?php

if ($_GET["password"] != $_GET["confirm_password"]){
  echo "Passwords must match";
}else {
  // do something
}
Mikee