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
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.
Link to comment
Share on other sites

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.