Jump to content

T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'


jwk811

Recommended Posts

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

[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.
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]
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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.