I am trying to send an email to myself when an error happens from filling out the php form -


i trying send email myself when error happens filling out php form instead of doing print="sorry error happened"

$error = "error happened".$order."\r\n"; $error_email = mail($to, $subject, $error, $headers2); $mail = @mail($email, $subject, $confirmation, $headers2);  if ($mail) {     header("location: http://www.test.com" ); } else ($error_email); 

you're not using brackets after else.

if($mail) {     header("location: http://www.test.com"); } else {     mail($to, $subject, $error, $headers2);     echo $error; } 

and never using echo $error error couldn't printed.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -