HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Need a script to save a web page to a text file
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML
View previous topic :: View next topic  
Author Message
BCDragoon



Joined: 12 Jun 2005
Posts: 1

PostPosted: Sun Jun 12, 2005 9:57 am     Need a script to save a web page to a text file Reply with quote

Hi, I want a script that will save a web page (like google.com) when my own page is loaded in a text file.
degsy



Joined: 23 Feb 2005
Posts: 2440
Location: North East, UK

PostPosted: Sun Jun 12, 2005 12:13 pm     Reply with quote

You can use the PHP file functions

Code:

<?php
// set the file name

$filename = "google.txt";

// open the file
$handle= fopen($filename,'w');
echo "Opened $filename";

// write the string to the file handle
$url = 'http://www.google.com';

$contents = file_get_contents($url);
fputs($handle, $contents);

// close the file
fclose($handle);

echo "<p>All done. Click <a href=$filename>here</a> to see the file</p>";
?>
djpollum



Joined: 07 Oct 2009
Posts: 1

PostPosted: Wed Oct 07, 2009 5:22 am     Reply with quote

Is it also possible that this script can download the images/flash files/etc., just like it happens when you save the website with a browser?
How do I do that?

Thnx in advance!
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial