Czy jest jakaś możliwość w PHP aby skrypt zrobił dokładną kopie html wpisanej strony i zapisał do pliku na serwerze?
Znalazłem taki skrypcik
<?php
$ip = $_SERVER["REMOTE_ADDR"];
function GetPage($url, $ip, $timeout = 5)
{
$result = '';
if(!isset($url['port'])) $url['port'] = 80; $port = $url['port'];
if(strlen($url['path']) == 0
) $url['path'] = '/';
if ($fp = @fsockopen($url['host'], $port, $errno, $errstr, $timeout)) {
"GET " . $url['path'] . " HTTP/1.0r\n" .
"Host: " . $url['host'] . ($port != 80 ? ':' . $port : '') . "r\n" .
"Accept: text/html; */*r\n" .
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)r\n" .
"X_Forwarded_For: " . $ip . "r\n" .
"Via: " . $ip . "r\n" .
"Client-IP: " . $ip . "r\n" .
"Connection: closer\nr\nr\n");
while (!feof($fp) && ($buf = fread($fp, 8192
))) $result .= $buf;
return $result;
} else
echo "Błąd $errno: $errstr !";
return false;
}
$zzz = GetPage('http://www.szmerak.pl', '83.9.251.98');
$plik=fopen("katalogi/strona2.html", "w+"); ?>
Ale zapisuje on do pliku
Bad Request
Your browser sent a request that this server could not understand.
Request header field is missing ':' separator.
Ten post edytował szmerak 13.12.2010, 04:13:23