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] Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/ 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 Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127129 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. Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127131 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] Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127133 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. Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127135 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] Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127137 Share on other sites More sharing options...
jwk811 Posted November 19, 2006 Author Share Posted November 19, 2006 great thanks! that worked! Link to comment https://forums.phpfreaks.com/topic/27788-t_constant_encapsed_string-expecting-or/#findComment-127140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.