|
|
|
|
|
для: Akira
(16.11.2005 в 20:40)
| | Какой именно код? | |
|
|
|
|
|
|
|
для: Akira
(16.11.2005 в 20:40)
| |
Попробуйте это
<?
function getdata($host, $path, $proxy = false, $proxyport = 80, $get = true)
{
$buffer = true;
if( !$proxy ) $proxy = $host;
$fp = @fsockopen("tcp://".$proxy, $proxyport, $errno, $errstr, 10);
if (!$fp) {
return false;
} else {
$out = "GET http://$host$path HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Referer: $host$path\r\n";
$out .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
$out .= "Connection: Close\r\n";
$out .= "\r\n";
fwrite($fp, $out);
if($get)
{
while (!feof($fp)) {
$buffer .= fgets($fp, 1024);
}
}
fclose($fp);
}
return $buffer;
}
function postdata($host, $path, $data, $proxy = false, $proxyport = 80, $get = false)
{
$buffer = true;
if( !$proxy ) $proxy = $host;
$fp = @fsockopen("tcp://".$proxy, $proxyport, $errno, $errstr, 10);
if (!$fp) {
return false;
} else {
$out = "POST http://$host$path HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Referer: $host$path\r\n";
$out .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Content-Length: ". strlen($data) ."\r\n\r\n";
fwrite($fp, $out.$data);
if($get)
{
while (!feof($fp)) {
$buffer .= fgets($fp, 1024);
}
} else {
fgets($fp, 1024);
}
fclose($fp);
}
return $buffer;
}
?>
|
| |
|
|
|
|
|
|
|
для: Artem S.
(16.11.2005 в 22:22)
| | У меня работает
echo getdata("softtime.ru","");
|
| |
|
|
|
|
|
|
|
для: Artem S.
(16.11.2005 в 22:22)
| | Спасибо.
Кстати об API кто знает? | |
|
|
|