Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> Prosze o pomoc ze skryptem !!
zaba12
post 3.05.2004, 13:49:44
Post #1





Grupa: Zarejestrowani
Postów: 223
Pomógł: 0
Dołączył: 29.08.2003
Skąd: Gliwice

Ostrzeżenie: (10%)
X----


Kod
<br>

<center>

<?

   $sc[czas]       =   czas odswierzania podawany w sekundach ( np. 120 );

   $sc[host]       =   "HOST";

   $sc[port]       =   port ( np. 8000 )

  $sc[template]   =   " Prowadzi:<b> [genre] </b><br>Gra od/do:<b>[gg]</b><br>";

#   $sc[template]   =   "<b>Gra od/do:</b> [gg]<br><b>Dj:</b> [genre]<br>";









?>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">

<META HTTP-EQUIV="Refresh" CONTENT="<?=$sc[czas]?>; >

</head>

<body bgcolor="#efefef">

<font color="black" face="arial" size="2">

<?

if($fp = fsockopen($sc[host], $sc[port]))

{

fputs($fp,"GET /index.html HTTP/1.0rnUser-Agent: XML Getter (Mozilla Compatible)rnrn");

fgets($fp);fgets($fp);fgets($fp);

       while(!feof($fp)) $in.=strip_tags(fgets($fp));

fclose($fp);

  # echo $in;



//  [status]

   $m[0]="Server is currently";

   $m[1]="";

   $mp[0]=strpos($in,$m[0]);

   $mp[1]=@strpos($in,$m[1]);

   $ml[0]=strlen($m[0]);

   $ml[1]=strlen($m[1]);



   $tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , 5 ) ) );



   if( $tmp[1][0] == "up" )

       $dat[status] = "on";

   elseif( $tmp[1][0] == "down" )

       $dat[status] = "off";

   else

       $dat[status] = "err";



   if($dat[status]=="on")

   {

   //  [gg]

       $m[0]="Stream AIM:";

       $m[1]="Stream IRC:";

       $mp[0]=strpos($in,$m[0]);

       $mp[1]=strpos($in,$m[1]);

       $ml[0]=strlen($m[0]);

       $ml[1]=strlen($m[1]);



       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );



       if( $tmp[1] ) $dat[gg] = $tmp[1];

       else $dat[gg] = "err";



   //  [genre]

       $m[0]="Stream Genre:";

       $m[1]="Stream URL:";

       $mp[0]=strpos($in,$m[0]);

       $mp[1]=strpos($in,$m[1]);

       $ml[0]=strlen($m[0]);

       $ml[1]=strlen($m[1]);



       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) );



       if( $tmp[1] ) $dat[genre] = $tmp[1];

       else $dat[genre] = "err";





   }

}

else

{

   $dat=array();

   $dat[status]="err";

}



$co             =   array('[status]','[gg]','[genre]');

$naco           =   array($dat[status],$dat[gg],$dat[genre]);

$sc[template]   =   str_replace($co,$naco,$sc[template]);



echo $sc[template];

?>

</font>

</body>

</center>

</body>

</html>




MOZE GO KTOS NAPRWIC ?
Go to the top of the page
+Quote Post
djpeterek
post 3.05.2004, 14:07:21
Post #2





Grupa: Zarejestrowani
Postów: 101
Pomógł: 0
Dołączył: 10.10.2003

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


chlopcze wyedytuj tego posta i stosuj bbcode i zmien temat bo inaczej temat zostanie zamkniety i nie krzycz na forum bo inaczej ci nikt nie pomoze


--------------------
Warsztat: Apache: 1.3.29 | MySQL: 3.23.58 | PHP: 4.3.4 | phpMyAdmin: 2.5.4
Narzędzia: Notatnik 0.1 - Photoshop 7.0
Go to the top of the page
+Quote Post
Seth
post 3.05.2004, 14:33:32
Post #3





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Prosze o napsainie mi na PW poprawnego tematu, to wtedy go odblokuje.

P.S. Nie dawaj bezmyslnie pomogl mi.
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 4.07.2025 - 17:14