visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: Is it possible to create static .htm files on the fly using a dynamic page?


By: PHP newbee U.S.A.  Date: 26/04/2003 00:00:00  English  Points: 300 Status: Answered
Quality : Excellent
Hi.

Is it possible in PHP to actually write all the dynamic made page to a file instead of the client browser or maybe both ???

When a client want this page I could actually first see if static file exist on server, if so display that (redirect to page), if not use the dynamic content?

Code that show me how to generate a static .htm file using my old dynamic pages will get the points.

I must be able to give the generated file a specific name, and to store it in a specific folder.


By: PHP newbee Date: 26/04/2003 22:33:00 English  Type : Comment
Have to add that I CAN NOT use a method where I just copy the generated page and store that page...

It will simply not work out right


By: ThG Date: 26/04/2003 23:13:00 English  Type : Comment

please can you explain yourself better?

do you have shell access to the server?

does the following shell command help you someway?
php -f somepage.php > somepage.html

(you may even try to system() that)

By: VGR Date: 26/04/2003 23:41:00 English  Type : Answer
yes.

look ob_start() function in PHP documentation :D

it's exactly what you need

the output will bufferred and at the end youy may either output it at once or write it to a file wherever you want (fopen, fputs, fclose).

look in th e examples
By: PHP newbee Date: 27/04/2003 00:27:00 English  Type : Comment
Thanks

Just what I was looking for!!!!


Do register to be able to answer

EContact
browser fav
page generated in 336.092950 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page