I'm having a slight issue with a login form I've created, basically I've got a checckbox with the value set to be 1 when checked. The form gets submit first time, php script checks for errors, namely if the value of this checkbox is equal to 1 or not. It always fails the first time I complete the form. If I then submit the form again, it accepts it fine. I can't for the life of me figure out why it's doing this. I;ve included the relevant code snippets below. If I use an echo statement to show the form contents after getting the POST values, the first time I submit the the form it just says false.
HTML Form
<form action="register.php" name="registrationForm2" method="post" enctype="multipart/form-data"> <input name="e2terms" value="1"<?php if($disp_2_terms==1) echo " checked="checked""; ?> class="optButton2" type="checkbox" /> I have read and agree to the terms & conditions <input class="button2" type="submit" name="saveLandlord" value="Continue" /> </form>
PHP Processing
$v_terms = strip_tags(mysql_real_escape_string($_POST['e2terms'], $db));
$_SESSION['register_2_terms'] = $v_terms;
if($v_terms!="1")
{ $formErrors[] = "You must read and agree to the terms and conditions if you wish to register"; }
All other fields on the form validate fine, apart from this one. Any suggestions on where I've gone wrong?
Many Thanks
Help



















