jwk811 Posted November 19, 2006 Share Posted November 19, 2006 can someone tell me whats wrong with this?this is the error im getting: [tt]T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' [/tt][code]$sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'"); $email_check = mysql_num_rows($sql_email_check); if($email_check > 0){ echo "Email Address is already being used! Please submit a different email address!"; } [/code] Quote Link to comment Share on other sites More sharing options...
printf Posted November 19, 2006 Share Posted November 19, 2006 The error is probably happen above that code, because there is no error with what you posted.printf Quote Link to comment Share on other sites More sharing options...
AndyB Posted November 19, 2006 Share Posted November 19, 2006 [quote]can someone tell me whats wrong with this?[/quote]Probably the source of the error is in a line above that code. The error message relates to the line where the php parser 'choked' which is not necessarily the line where the [b]source[/b] of the error occurs. Quote Link to comment Share on other sites More sharing options...
jwk811 Posted November 19, 2006 Author Share Posted November 19, 2006 i cant post the whole thing because its really long but heres that part and some code above it.. maybe this can tell you what might be wrong.. thanks![code]/***************************************************/ if ($email_address) { if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email_address)) { echo "The email you entered is not valid. Please try again. <br/>"'; exit(); }} /***************************************************/ if($email_address != $email_address2){ echo "Emails do not match, please try again.<br />"; } if(isset($password)){ if($password != $password2){ echo "passwords do not match"; } } if(strlen($username) > 12 || strlen($username) < 4 ){ echo "Username should have 4 - 12 characters only"; if(strlen($username) > 12 ){ echo "username is too long"; } if(strlen($username) < 4 ){ echo "username is too short"; } }/***************************************************/ $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'"); $email_check = mysql_num_rows($sql_email_check); if($email_check > 0){ echo "Email Address is already being used! Please submit a different email address!"; } [/code] Quote Link to comment Share on other sites More sharing options...
haaglin Posted November 19, 2006 Share Posted November 19, 2006 echo "The email you entered is not valid. Please try again. <br/>"';Remove the ' at the end. Quote Link to comment Share on other sites More sharing options...
printf Posted November 19, 2006 Share Posted November 19, 2006 The error is here...[code]if ($email_address) { if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email_address)) { echo "The email you entered is not valid. Please try again. <br/>"';//------------------------------------------------------------------------^ exit(); }}[/code] Quote Link to comment Share on other sites More sharing options...
jwk811 Posted November 19, 2006 Author Share Posted November 19, 2006 great thanks! that worked! 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.