|
|
|
| нихрена не хочет работать ругается на ссылку, типа не поддерживает такой формат, как обмануть можно?
<?php
$st="http://www.yandex.ru/yandsearch?Link=http%3A%2F%2Fwww.isospan.ru+&serverurl=http%3A%2F%2Fwww.kroi.ru%2F";
$fp = fsockopen($st, 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: $st\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$str1 = fgets($fp, 128);
$substr_count = substr_count($str1,"Результат поиска: страниц");
if ($substr_count>0)
{
echo ($substr_count);
}
}
fclose($fp);
}
?> | |
|
|
|
|
|
|
|
для: invit
(27.06.2005 в 17:50)
| | http:// не нужно указывать - это автоматически следует из того, что вы обращаетесь к 80 порту, кроме того, все параметры следует указывать в HTTP-команде GET, т.е. переписать ваш скрипт на манер
<?php
$st="www.yandex.ru";
$fp = fsockopen($st, 80, $errno, $errstr, 30);
if (!$fp)
{
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET /yandsearch?Link=http%3A%2F%2Fwww.isospan.ru+&serverurl=http%3A%2F%2Fwww.kroi.ru%2F HTTP/1.1\r\n";
$out .= "Host: $st\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$str1 = fgets($fp, 128);
$substr_count = substr_count($str1,"Результат поиска: страниц");
if ($substr_count>0)
{
echo ($substr_count);
}
}
fclose($fp);
}
?>
|
| |
|
|
|
|
|
|
|
для: cheops
(27.06.2005 в 21:01)
| | Огромное спасибо, все получилось | |
|
|
|