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
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.
Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.