I have tried to add die("The passwords don't match"); also insted of echo. But this still seems to not do anything at all when register is clicked. The variable names match the ones in the contact form perfectly. I can only think of one thing. Might sound funny It it because I'm already logged in (registered)?. I'm sorry if thsi question has been answered but I did not see any answer that helped me with someone in a similar situation. Cheers!
<?php
require('inc/phpfunctions.php');
if(isset($_POST['submit'])){
//perform the verification
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
if ($email1 == $email2){
if($pass1 == $pass2){
//All good. Carry On.
}else{
echo "Sorry your passwords do not match. <br />";
exit();
}
}else{
echo "Sorry your email's do not match<br /><br />";
}
}else{
$form = <<<EOT
<form action="register.php" method="POST">
First Name: <input type= "text" name="name" /><br />
Last Name: <input type= "text" name="lname" /><br />
Username: <input type= "text" name="uname" /><br />
Email: <input type= "text" name="email1" /><br />
Confirm Email: <input type= "text" name="email2" /><br />
Password: <input type= "password" name="pass1" /><br />
Confirm Password: <input type= "password" name="pass2" /><br />
<input type="submit" value="Register" name"submit" />
</form>
EOT;
echo $form;
}
?>