I'm trying to validate a form before saving the input to MySQL. Here is a sample of what I'm doing. [code] if(isset($_POST["create"])) { if((!$_POST['uname']) | strlen($_POST['fname']) < 2 ) { $print_again = true; } if((!$_POST['passwd']) | strlen($_POST['passwd']) < 3 ) { $print_again = true; } if($print_again) { //do nothing } else{ echo('everything is good'); } }[/code] What shold happen is: If the variable is invalid, $print_again is set to true, and nothing changes. But if the variable is valid then a messages appears on the screen. What really happens: After the variable is set to true once it is always true. How can I fix this since this code is in a submit button? I've tried $print_again = false; before the if statements, but then $print_again is always set to false.