Jump to content

Smarty error when using ajax


scrivo

Recommended Posts

Im trying to make a price quote form using ajax.

it works fine as a stand alone php file. ive made up a template file for WHMCS and am getting this error:

 

Fatal error: Smarty error: [in serverquote.tpl line 363]: syntax error: unrecognized tag: error_reporting(0); if (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) echo nl2br("

 

can anyone help me out?

thanks

 

Josh

Link to comment
Share on other sites

thanks john I tried that out and i either get this error:

 

Fatal error: Smarty error: [in serverquote.tpl line 364]: syntax error: unrecognized tag: {php (Smarty_Compiler.class.php, line 446) in /home/mediafo/public_html/includes/smarty/Smarty.class.php on line 1093

 

or depending on where i put it, none of the content appears and the footers all messed up.

is there anything else i can try?

Link to comment
Share on other sites

ok, ive messed around with it a fair bit and got it to the stage where everything loads, but some of the code is printing on the page rather than actioning.

 

this is the problem part of the code

<?php
} else {

       error_reporting(0);

     	if  (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))

  	//Message sent!
  	//It the message that will be displayed when the user click the sumbit button
  	//You can modify the text if you want
     	echo nl2br("
   	<div class=\"MsgSent\">
		<h1>Congratulations!!</h1>
		<p>Thank you <b><?=$name;?></b>, your message is sent!<br /> I will get back to you as soon as possible.</p>
	</div>
   ");
      	else

    // Display error message if the message failed to send
       echo "
   	<div class=\"MsgError\">
		<h1>Error!!</h1>
		<p>Sorry <b><?=$name;?></b>, your message failed to send. Try later!</p>
	</div>";
}
?>

 

where would be the best parts for the {literal} tags, coz i tried a few places and end up with the same result.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated