Jump to content


Photo

Generate HTML file - Help


  • Please log in to reply
2 replies to this topic

#1 renno

renno
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 24 August 2006 - 02:14 PM

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

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 August 2006 - 02:19 PM

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.

#3 renno

renno
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 24 August 2006 - 02:26 PM

Thanks very much...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users