Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.