Jump to content

Generate HTML file - Help


renno

Recommended Posts

I'm wishing to generate and populate an HTML file on the submission of a form but don't know how to approach the problem. I need to click the form submit button which builds a new html file in a specific site folder and for that file to contain or output variables from the submitted form. I don't know if I have to use a sort of template so that the generated file has a predefined layout... If someone knows of a related article or could point me in the right direction, it would be much appreciated.

Many thanks...
Link to comment
https://forums.phpfreaks.com/topic/18540-generate-html-file-help/
Share on other sites

You could have a predefined template and where your variables are supposed to go. For for example you have something like the following where your variables are supposed to go
{your_var_name_here}
To replace that with the actuall variable use str_replace.

You can create the file too with the use fopen, fwrite and fclose.

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.