faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 8 people (88%) answered Yes
Recently 3 of 4 people (75%) answered Yes

Entry

I have made a web page generator, I'm having trouble trapping the parsed php3 file and saving it as a normal html file on the server..any ideas???

May 16th, 2000 12:19
Matt Gregory, Dave Murad,


Well, not that this is a normal thing to do with PHP, but your best bet 
is to print all the text you return to the browser out to an open file 
stream as well (open with fopen, write with fwrite).
Some hosts will not allow you to do this since it is a security issue.
Your second option is to do what all the Search engines do.  Hit the 
url of the html generation script and then, once you do your get 
command, save the returned information to blah.html. (where blah is the 
name you want to call the html file.)
I would not name PHP as the best tool for getting and writing the html 
file.  This is something better suited for perl or python.