I am wondering if anyone out there can help with my form Validation Please?I am having a few problems trying to synchronized out how certain bits of the actual structure of the script works together.\[code\]<?php$flag="OK"; // This is the flag and we set it to OK$msg=""; // Initializing the message to hold the error messages if(isset($_POST['Send'])){ $key=substr($_SESSION['key'],0,4); $num_key = $_POST['num_key']; if($key!=num_key){ $msg=$msg."Your Key not valid! Please try again!<BR>"; $flag="NOTOK"; } else{ $msg=$msg."Your Key is valid!<BR>"; $flag="OK"; } }$email=$_POST['email'];echo "Your Email: ".$email." is";if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){$msg=$msg."Invalid email<BR>";$flag="NOTOK"; }else{$msg=$msg."Valid Email<BR>";$flag="OK";}$password=$_POST['password'];if(strlen($password) < 5 ){ $msg=$msg."( Please enter password of more than 5 character length )<BR>";$flag="NOTOK"; }if($flag <>"OK"){echo "$msg <br> <input type='button' value='http://stackoverflow.com/questions/2085090/Retry' onClick='history.go(-1)'>";}else{ // all entries are correct and let us proceed with the database checking etc