[php]łączenie sie ze "stronami shoutcast"

0

witam,
jako mozna "odczytac" za pomoca php strone http://213.202.240.186:8230/index.html ? Gdy stosuje:

<?php
  include('http://213.202.240.186:8230/index.html');
?>

to wyskakuje mi taki komunikacode>to wyskakuje mi taki komunikat:
Warning: main(http://213.202.240.186:8230/index.html) [function.main]: failed to create stream: HTTP request failed! ICY 404 Resource Not Found in /klub/vmail/mehl/.www/index.php on line 2

Warning: main() [function.main]: Failed opening 'http://213.202.240.186:8230/index.html' for inclusion (include_path='.:/usr/lib/php') in /klub/vmail/mehl/.www/index.php on line 2

0

Spróbuj przez sockety wysłać zapytanie GET. Przykłady tutaj

0
Bula napisał(a)

Spróbuj przez sockety wysłać zapytanie GET. Przykłady tutaj

Spróbowałem z HTTP Client class

<?php

include "Client.php";

$http = new Net_HTTP_Client();
$http->Connect( "http://213.202.240.186", 8230 ) or die( "Connect problem" );
$status = $http->Get( "/index.html" );
if( $status != 200 )
die( "Problem : " . $http->getStatusMessage() );
else
echo $http->getBody();
$http->Disconnect();

?>

i podobny błąd:

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /klub/vmail/mehl/.www/soc/Client.php on line 632

Warning: fsockopen() [function.fsockopen]: unable to connect to http://213.202.240.186:8230 in /klub/vmail/mehl/.www/soc/Client.php on line 632
Problem : Inappropriate ioctl for device
0

mi takie coś działa:

<?php  

      $r = '';
      if ($fp = @fsockopen('213.202.240.186', '8230', $errno, $errstr, 5)){
          fputs($fp, 
            "GET /index.html HTTP/1.0\r\n" .
            "Host: 213.202.240.186:8230\r\n" .
            "Accept: text/html\r\n" . // to jest ważne
            "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" . // i to !
            "Connection: close\r\n\r\n\r\n");

          while (!feof($fp) && ($buf = fread($fp, 8192))) $r .= $buf;

          fclose($fp);
      } else
        echo "Błąd $errno: $errstr !";

echo $r;
?>

bo jeśli user-agent będzie jakiś dziwny to serwer może zacząć nam przesyłać sygnał audio zamiast tej strony

0

dzieki =] u mnie tez dziala

1 użytkowników online, w tym zalogowanych: 0, gości: 1