Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Problem] ze skryptem, Wyskakuje: "error"
Forgoot
post
Post #1





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 17.03.2004
Skąd: Suwałki

Ostrzeżenie: (0%)
-----


Mam tutaj kod php skryptu, który wedlug zalożenia miał pobierać repertuar TVP1 (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)

  1. <?
  2.   $fp = fsockopen (&#092;"www.tvp.pl\", 80, $errno, $errstr, 30);
  3.   if( $fp )
  4.   {
  5.    fputs ($fp, &#092;"GET /_repertuar/home.asp/1.0rnHost: www.tvp.plrnrn\");
  6.    $str = '';
  7.    while( !feof($fp) )
  8.    {
  9.     $str .= fgets( $fp, 128 );
  10.    }
  11.    fclose ($fp);
  12.    if(substr($str, 9, 3) != &#092;"200\")
  13.    {
  14.     print 'error';
  15.    }else{
  16.     print 'strona znaleziona';
  17.    }
  18.   }
  19.  ?>


Jednak w przeglądarce pojawia się tylko:

Cytat
error


Ten post edytował Forgoot 23.10.2004, 09:10:19
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ADeM
post
Post #2





Grupa: Zarejestrowani
Postów: 455
Pomógł: 69
Dołączył: 23.10.2004
Skąd: Oświęcim

Ostrzeżenie: (0%)
-----


<?
$fp = fsockopen ("www.tvp.pl", 80, $errno, $errstr, 30);
if( $fp )
{
fputs ($fp, "GET /_repertuar/home.asp HTTP/1.0\r\nHost: www.tvp.pl\r\n\r\n");
$str = '';
while( !feof($fp) )
{
$str .= fgets( $fp, 128 );
}
fclose ($fp);
if(substr($str, 9, 3) != "200")
{
print 'error';
}else{
include("http://www.tvp.pl\r\n\r\n");
}
}
?>



Chociaż nie jestem pewien czy to zadziała... Jak zrobiłem błąd to go poprawcie...
I nie wiem czy include tak zadziala.. (IMG:http://forum.php.pl/style_emoticons/default/blink.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 23:38