Languages :: PHP :: Is it possible to create static .htm files on the fly using a dynamic page? |
|||
| By: PHP newbee |
Date: 26/04/2003 00:00:00 |
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 | 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 | 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 | 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 | Type : Comment |
|
| Thanks Just what I was looking for!!!! |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








