Mailing html received from a form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ibeaugie
Forum Newbie
Posts: 1
Joined: Fri Mar 26, 2010 9:00 am

Mailing html received from a form

Post by ibeaugie »

I'm creating a simple order form that has quantity boxes. On submission it goes to the processing php page. I only want it to output tables per prod. category and output <tr>'s and <td>'sfor items that are greater than 0. I have this all fine, as in if I just had the form output the html and tables as needed. I need to know how to take the processed php and use the html with only the necessary data and put it into mail. I know I can't set the php with if's as a variable, so, what's a better option.

-Beau
Alkis
Forum Commoner
Posts: 31
Joined: Fri Mar 26, 2010 8:41 am

Re: Mailing html received from a form

Post by Alkis »

Take some time to learn a few things about the smarty php template engine: http://www.smarty.net.

by using e.g. $tpl->fetch('template.tpl') you can fetch the contents of a template, after you have applied variables and other stuff. Smarty is a life saver.

After achieving this, do not forget to use full urls on the template and not single web paths, otherwise they want work inside the recipient's mail box.
Post Reply