Re: [PHP] create HTML page on the fly

2005-10-25 Thread Angelo Zanetti
Hi Miles. Well the system that I wrote generates HTML newsletters using templates etc... and before the newsletter is sent out it has to go to moderators for approval.So a moderator will have a link in his email received and it will point to the newsletter in HTML format, also it is needed so

Re: [PHP] create HTML page on the fly

2005-10-25 Thread Miles Thompson
At 10:26 PM 10/25/2005, Angelo Zanetti wrote: Hi guys. I've created a small newsletter application and the content of the newsletter is stored in a DB (the HTML). However once the newsletter is complete and the user clicks a button I want the newsletter/html file to be created on the server

Re: [PHP] create HTML page on the fly

2005-10-25 Thread David Tulloh
Angelo Zanetti wrote: > ... > > I assume that I will use fwrite() to add the HTML to the file, I need to > know how to actually create the file before adding the content to it. > You need to open the file before you can write to it, you do that using fopen(). You can choose to create a file or

Re: [PHP] create HTML page on the fly

2005-10-25 Thread Angelo Zanetti
thanks guys, bruce's answer was what I was looking for. regards Angelo David Tulloh wrote: Angelo Zanetti wrote: ... I assume that I will use fwrite() to add the HTML to the file, I need to know how to actually create the file before adding the content to it. You need to open the file b

Re: [PHP] create HTML page on the fly

2005-10-25 Thread Adrian Bruce
I think you can use a different handle when using fwrite() which will make php create a file if one is not already there: something like if ($fp = fopen($file,"x+")){ echo"opened"; } fwrite($fp,$content); fclose($fp); Ade Angelo Zanetti wrote: Hi guys. I've created a small