Jump to content


Photo

I can't fix this error


  • Please log in to reply
2 replies to this topic

#1 scott532

scott532
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSanta Barbara, CA. (USA)

Posted 21 August 2006 - 07:03 PM

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

						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
						?>

Please Help, Thank You

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 21 August 2006 - 07:08 PM

make sure you nest your statements properly....


BOTH the final else code blocks have no starting if block
follow me on twitter @PHPsycho

#3 Jeremysr

Jeremysr
  • Members
  • PipPipPip
  • Advanced Member
  • 199 posts
  • LocationSaskatchewan, Canada

Posted 21 August 2006 - 07:14 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users