Jump to content

Data from a Form to a Template


denoteone

Recommended Posts

I am a beginner at php...so bare with me. 

 

I have a PHP script that gets data from a form and sends it to an email address. Got that working no problem.

 

now I would like to take the data form the form and instead of just emailing it I need to put it into a template that I have created using html and tables and then emails this template to a specific email address.

 

??? Is this possible and for a beginner is it practical?….any help would be cool thanks

 

Link to comment
https://forums.phpfreaks.com/topic/67061-data-from-a-form-to-a-template/
Share on other sites

All you should need is file_get_contents().

 

The easiest way for you to do this is to split your template into two files. One is the header and there other, the footer. Use file_get_contents() to read the header, concatinate the form data to that string as you would have put it in the email, then use file_get_contents() again to put the footer at the end of the string. If you are attempting to put individual pieces of data into table cells, it is definately better to create the table at run-time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.