<?php
if (!isset($_POST['submit']))
{
echo '
<form action="" method="POST">
enter password: <input type="password" name="password1"><br>
confirm password: <input type="password" name="password2"><br>
<input type="submit" name="submit" value="submit">
</form>
';
}
else
{
if ($_POST['password1'] == $_POST['password2']) {echo 'the passwords match';}
else {echo 'the passwords do not match';}
}
?>