If elseif else statement question PHP?

Mark

New member
We have the following code:
Re-type Password:
<input type="password" name="retypepassword" maxlength="20" value="<?=$_POST['retypepassword']?>" />
<?php
if($_POST['retypepassword'] == "")
echo "Retype password";
elseif ($_POST['retypepassword'] == ($_POST['password']))
echo "";
elseif
($_POST['retypepassword'] != ($_POST['password']))
echo "Passwords do not match!"
?>

When we first go on our page it displays next to the "retype password" textbox to retype password. Like this

Re-type Password: HERE IS THE TEXTBOX Retype password

We want the message saying to retype password to only appear when the user tries to submit the page and the field is left blank. Can you help?
 
Back
Top