Html Pages Archiving

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

Html Pages Archiving

Post by php_ghost »

Hi everyone.

I need help in archiving web pages from a website.

the original link is something like this

Code: Select all

index.php?mact=News,cntnt01,detail,0&cntnt01articleid=154&cntnt01returnid=58
Now I want to save it in an archive folder in the web host where in it will no longer have to access the database. It's like a saved page and not a php file anymore.

Or if you guys have any other ideas on how to do this in a different way (not necessarily save the file as an html page) please help me guys.

Thanks in advance. :wink:
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

It should be too difficult to munge the filename into another form that can be an HTML file, though if you're not going to have the database you'll need to either archive the database or use the PHP to pass the user to the HTML cache file.
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

Post by php_ghost »

nevermind guys i already found a way.

I used file() to read the result of index.php?mact=News,cntnt01,detail,0&cntnt01articleid=154&cntnt01returnid=58

All I need to do now is to save it as an html file and place it in the appropriate folder.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

file_get_contents() and file_put_contents() (php5+) may be more appropriate for such a task.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply