Copying a web page to the server.
| From: | Ross Fleming | Date: | Wed, 03 Oct 2001 12:46:16 +0000 |
| Subject: | Copying a web page to the server. | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-9666@lists.php.net to get a copy of this message | ||
Hi, I'm trying to make a copy of a webpage, specified by the user (say,
through a form) to the server itself. So far I've done this:
*******************************
$LocalFile="written.html";
$fp = @fopen($file,"r");
if ($fp)
{
$out=fopen ($LocalFile,"w");
while (!feof($fp))
{
$temp=fread($fp,4096);
fputs($out, $temp);
}
print"Page written to written.html\n";
}
else
{
print"This page does not exist\n";
}
fclose($fp);
fclose($out);
*******************************
This works, but takes a wee bit of time to do it and I was wondering if
anyone know whether there is simply a command that does it?
Ta
Ross