AsiaUnderworld Posted July 25, 2009 Share Posted July 25, 2009 should be a simple fix this, but my mind has just gone, late night Parse error: syntax error, unexpected T_VARIABLE, expecting '(' on line 36 heres the code : <?php if(isset($_POST['submit'])) { // make all the post vars safe $email = QuerySecure($_POST['email']); /// Check if all fields are filled out and not empty if (strlen($email) < 1 ) echo '<div class="redalert>You have left a field blank, all fields must be completed, please go back and correct this.</div><br />'; elseif $sql = mysql_query("SELECT email FROM pre_register WHERE email = $email LIMIT 1"); if(mysql_num_rows($sql) != 0) echo '<div class="redalert">You have already pre-registered</div><br>'; else { mysql_query("INSERT INTO pre_register SET email = $email"); } } } ?> Quote Link to comment Share on other sites More sharing options...
ldougherty Posted July 25, 2009 Share Posted July 25, 2009 echo '<div class="redalert>You have left a field blank, all fields must be completed, please go back and correct this.</div><br />'; Your missing a " Should be echo '<div class="redalert">You have left a field blank, all fields must be completed, please go back and correct this.</div><br />'; Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 25, 2009 Share Posted July 25, 2009 you have elseif elseif what? proper format: <?php if(isset($_POST['submit'])) { // make all the post vars safe $email = QuerySecure($_POST['email']); /// Check if all fields are filled out and not empty if (strlen($email) < 1 ){ echo '<div class="redalert">You have left a field blank, all fields must be completed, please go back and correct this.</div><br />'; } elseif($something == $something_else){ $sql = mysql_query("SELECT email FROM pre_register WHERE email = $email LIMIT 1"); if(mysql_num_rows($sql) != 0) echo '<div class="redalert">You have already pre-registered</div><br>'; else { mysql_query("INSERT INTO pre_register SET email = $email"); } } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.