When you have a register system you usually want user to comfirm their password and e-mail sometimes user name this make sure the user put in what they really want
so there need to be a HTML form to have a input box
Code:
<form action="register.php" method="post">
<input type="hidden" name="page_mode" value="register">
Password
<input type="password" name="password" size="30">
Confirm Password
<input type="password" name="conf_password" size="30">
<input type="submit" value="Register" size="30">
</form>
this is a very basic form and now we need to tell the browser to change the inputs to php form so we can use them easily
$password = $_POST['password'];
$conf_password = $_POST['conf_password'];
if ($password != $conf_password)
$error_string .= 'The password and confirmation password do not match.';
You can put else register something like that but the main part is checking if it the same and NOT the same is !=
or you can do
if ($password == $conf_password)
echo 'two password are the same!'
**== mean exactly the same 1=1 2=2
= mean like is error_string . IS the password don't match..
________________
TO BE MORE ORGANIZE :
$error_string . is like a Variables that say error you can do
if ($password != $conf_password)
echo 'The password and confirmation password do not match.<br>';
if you do this then you will put the all those code in the middle of the HTML form, because it echo at where you put the code. so I have this error_string. I will put <?php echo $error_string; ?> at the middle of HTML instead of those code.
_________________