schug.trent Posted November 22, 2008 Share Posted November 22, 2008 I have a contact form in HTML that uses a file, send.php, to send the entered info to my email. when the "successfully sent" message comes up I want it to be able to put HTML in that spot. the code for that part looks like this in the php file. $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "\n\n<br>Your quote request was sent successfully. You will be contacted within two business days. <br><br>http://www.studio9design.info"; } else {print "We encountered an error sending your mail, please try sending an email to trent@studio9design.info or calling us at 715-688-9640"; } ?> Where it says "{print "\n\n<br>Your quote request was sent successfully. You will be contacted within two business days. <br><br>http://www.studio9design.info"; }" I would rather put some html in there. I have tried this $sent = mail($to, $subject, $message, $headers) ; if($sent) ?> <html><body><table><tr><td>blah blah blah code code code</td></tr></table></body></html> <? else {print "We encountered an error sending your mail, please try sending an email to trent@studio9design.info or calling us at 715-688-9640"; } ?> But it doesn't work. I get a syntax error regarding the '"else" before the last {print...........} any suggestions? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 22, 2008 Share Posted November 22, 2008 You'll need to use braces: $sent = mail($to, $subject, $message, $headers) ; if($sent){ ?> <html><body><table><tr><td>blah blah blah code code code</td></tr></table></body></html> <? }else{ print "We encountered an error sending your mail, please try sending an email to trent@studio9design.info or calling us at 715-688-9640"; } ?> Quote Link to comment Share on other sites More sharing options...
schug.trent Posted November 22, 2008 Author Share Posted November 22, 2008 great! Thanks a million worked perfect. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.