Jump to content

Archived

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

scott532

I can't fix this error

Recommended Posts

Parse error: parse error, unexpected T_ELSE in /usr3/home/cuttingclub.com/htdocs/pravana/v2/php/mail_list/php_mail.php on line 122

[code]
if (strpos($_POST['to'],"@") >= 0) {

//send the mail
echo "<BR>To: $to<P>";
echo "Subject: $_POST[subject]<P>";
echo "Body: $body<P>";
echo "$from_header<P>";
echo "$add_header<P>";
if(!isset($add_header)){
if (mail($to, $_POST['subject'], $body)) {
echo "<h3>Your email has been sent</h3>";
} else {
echo "An error occured, and your email has not been sent";
}
} else if (mail($to, $_POST['subject'], $body, "$from_header"."$add_header")) {
echo "<h3>Your email has been sent</h3>";
} else {
echo "An error occured, and your email has not been sent";
}
} else {
echo "A bad email address was encountered";
}
} else { // Line 122
?>
[/code]

Please Help, Thank You

Share this post


Link to post
Share on other sites
make sure you nest your statements properly....


BOTH the final else code blocks have no starting if block

Share this post


Link to post
Share on other sites
I think you have too many }'s. Try removing each one right before the else or elseif statements (except for the first else statement). Because it looks like you have 2 }'s before each one.

Share this post


Link to post
Share on other sites

×

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.