Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 18-03-2009, 01:09 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2005
Location: Bhubaneswar
Posts: 24
Default How to save a web page as HTML using PHP


The question is simple i want to save the content of any webpage to simple html so that it can be viewed locally. I can easily get the page content using get_file_content or using curl but the links(a href), scripts and css wont work as they are defined by their relative path in most of the pages. So i wanna to know how to fix those so that the page will work by itself if it is run locally from my system? I suppose they can be fixed using regular expression but i am not very good at regex.


Please Help.
__________________
What Is Seen Is Not Always True
jitun is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-03-2009, 01:41 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: How to save a web page as HTML using PHP

You will have to use regex to place the <baseurl> and then write the file to disk using fopen and fwrite.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by gforz
- by soumya

Advertisement




All times are GMT +5.5. The time now is 03:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2