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 [email protected] 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 [email protected] 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? Link to comment https://forums.phpfreaks.com/topic/133832-php-html-mixture-problems/ 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 [email protected] or calling us at 715-688-9640"; } ?> Link to comment https://forums.phpfreaks.com/topic/133832-php-html-mixture-problems/#findComment-696518 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. Link to comment https://forums.phpfreaks.com/topic/133832-php-html-mixture-problems/#findComment-696521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.