Forum Moderators: coopster

Message Too Old, No Replies

Parse error: parse error, unexpected $end in

         

Flolondon

6:30 am on May 4, 2004 (gmt 0)

10+ Year Member



hi there

what have i done wrong, this is the message, i get when using a php checker...Parse error: parse error, unexpected $end in

i have researched and it states that it could be an excessive bracket or lack of bracket. please help..

function checkEmail($email) { if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]",
$email)) { return FALSE; } list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost)) { return TRUE; } else { if(fsockopen($Domain,
25, $errno, $errstr, 30)) { return TRUE; } else { return FALSE; } { {
if(checkEmail($_POST['email']) == FALSE) { echo" Sorry E-mail entered
is not valid."; } else { echo "Success - please to to your email and click
on the link to registrar!."; }
?>

jatar_k

6:40 am on May 4, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the braces are fairly messed up. Try reformatting your code, it helps a lot with brace matching.

function checkEmail($email) { 
if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email)) {
return FALSE;
}
list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost)) {
return TRUE;
} else {
if(fsockopen($Domain, 25, $errno, $errstr, 30)) {
return TRUE;
} else {
return FALSE;
}
{ { // remove these 2
if(checkEmail($_POST['email']) == FALSE) {
echo" Sorry E-mail entered is not valid.";
} else {
echo "Success - please to to your email and click on the link to registrar!.";
}
} // add these 2
}

Flolondon

5:38 am on May 8, 2004 (gmt 0)

10+ Year Member



I tried it and it worked. Thank you so much.

ergophobe

2:49 pm on May 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Get a text editor that does brace and paren matching. Lots of programming-oriented editors do and it saves so many headaches.