![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 28.05.2007 Ostrzeżenie: (0%) ![]() ![]() |
witam
mam skrypt php ze statystykami w miejscu gdzie powinien sie na stronce wyswietlic wpisuje <? include ("http://radiolaguna.nazwa.pl/staty.php"); ?> ale nie wyswietla sie ten skrypt co moze byc nie tak? ponizej sam skrypt ----------------------------------------------------------------------------------------------------------- <!-- SKRYPT STATYSTYK SERWERA SHOUTCAST DLA RADIA INTERNETOWEGO grafika, html & uzupelnienia w skrypcie php © Majkell 2005 Portal EMSoft - Polskie Centrum SHOUTcast http://www.radiostacja.prv.pl --> <? $sc[czas] = 180; $sc[host] = "87.118.100.10"; $sc[port] = 9992; $sc[template1] = "<b>[radio]</b>"; $sc[template2] = "<b>[aim]</b>"; if($fp = fsockopen($sc[host], $sc[port])) { fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); fgets($fp);fgets($fp);fgets($fp); while(!feof($fp)) $in.=strip_tags(fgets($fp)); fclose($fp); // [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") { // [radio] $m[0]="Stream Title:"; $m[1]="Content Type:"; $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[radio] = $tmp[1]; else $dat[radio] = "err"; // [aim] $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[aim] = $tmp[1]; else $dat[aim] = "err"; // [genre] $m[0]="Stream Genre:"; $m[1]="Stream URL:http://radiolaguna.nazwa.pl"; $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"; // [ile] $m[0]="kbps with"; $m[1]="listeners"; $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] , $mp[1]-$mp[0]-$ml[1]-2 ) ) ); if( $tmp[1] ) $dat[ile] = $tmp[1][0]; else $dat[ile] = "err"; // [max] $m[0]="kbps with"; $m[1]="listeners"; $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] , $mp[1]-$mp[0]-$ml[1]-2 ) ) ); if( $tmp[1] ) $dat[max] = $tmp[1][2]; else $dat[max] = "err"; // [peak] $m[0]="Listener Peak:"; $m[1]="Average"; $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]-7) ); if( $tmp[1] ) $dat[peak] = $tmp[1]; else $dat[peak] = "err"; } } else { $dat=array(); $dat[status]="err"; } $co = array('[status]','[radio]','[aim]','[genre]','[ile]','[max]','[peak]'); $naco = array($dat[status],$dat[radio],$dat[aim],$dat[genre],$dat[ile],$dat[max],$dat[peak]); $sc[template1] = str_replace($co,$naco,$sc[template1]); $sc[template2] = str_replace($co,$naco,$sc[template2]); $fp1 = @fsockopen($sc[host], $sc[port], &$errno, &$errstr, 10); if (!$fp1) { $text = "Aktualnie nie nadajemy"; } else { fputs($fp1, "GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n"); for($i = 0; $i < 1; $i++) { if (feof($fp1)) break; $fp_data1 = fread($fp1, 31337); usleep(500000); } $fp_data1 = ereg_replace("^.*<body>", "", $fp_data1); $fp_data1 = ereg_replace("</body>.*", "", $fp_data1); list($current1, $status1, $peak1, $max1, $reported1, $bit1, $song1) = explode(",", $fp_data1, 7); if ($status1 == "1") $text = "$song1"; else $text = "Aktualnie nie nadajemy"; } // TU WSTAW ADRESY DO ZDJEC DJ'OW - WEDLUG WZORU if ($dat[aim] == "autopilot") $fotka = "pilot.jpg"; else if ($dat[aim] == "Agusia_78") $fotka = "Agusia_78.jpg"; else if ($dat[aim] == "Krysia") $fotka = "Krysia.jpg"; else if ($dat[aim] == "Asia") $fotka = "Asia.jpg"; else if ($dat[aim] == "OLKA") $fotka = "OLKA.jpg"; else $fotka = "brak.gif"; ?> <table cellspacing="0" cellpadding="0" height="216" width="140" border="0" background ="tlo.gif"> <tr><td width ="100%" height ="19" colspan ="2"> <center><font size ="2" face ="Verdana" color ="black"><b> Radio LAGUNA </b><br></font></center> </td></tr> <tr><td width ="80%" height ="15" valign ="top" colspan ="2"> <center><font size ="1" face ="Arial"><b> <A href ="http://www.radiolaguna.nazwa.pl" target ="_blank"><font color ="brown">www.radiolaguna.dl.pl</font></A> </b><br></font></center> </td></tr> <tr><td width ="100%" height ="15" colspan ="2"> </td></tr> <tr><td width ="100%" height ="17" valign ="top" colspan ="2"> <center><font size ="2" face ="Courier" color ="black"><b> <MARQUEE width="80%" SCROLLAMOUNT="4" behavior ="scroll" onMouseOver='this.stop()' onMouseOut='this.start()'> <? echo $sc[template1]; ?> </MARQUEE> </font></center> </td></tr> <tr><td width ="100%" height ="15" colspan ="2"> </td></tr> <tr><td width ="100%" height ="17" valign ="top" colspan ="2"> <center><font size ="2" face ="Courier" color ="black"><b> <MARQUEE width="80%" SCROLLAMOUNT="4" behavior ="scroll" onMouseOver='this.stop()' onMouseOut='this.start()'> <? echo $text; ?> </MARQUEE> </font></center> </td></tr> <tr><td width ="100%" height ="15" colspan ="2"> </td></tr> <tr><td width ="100%" height ="17" valign ="top" colspan ="2"> <center><font size ="2" face ="Courier" color ="black"><b> <MARQUEE width="80%" SCROLLAMOUNT="4" behavior ="alternate" onMouseOver='this.stop()' onMouseOut='this.start()'> <? echo $sc[template2]; ?> </MARQUEE> </font></center> </td></tr> <tr><td width ="100%" height ="6" colspan ="2"> </td></tr> <tr><td width ="65" height ="80" valign ="top"> <a href ="http://87.118.100.10:9992/listen.pls"><img src ="separ.gif" width ="65" height ="70" border ="0"></a><br clear ="all"> <td width ="75" height ="80" valign ="top"> <? print "<img src ='$fotka' width ='62' height ='70'>"; ?> <br clear ="all"> </td></tr> </table> ------------------------------------------------------------------------------------------------- z góry dziękuje za pomoc |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 176 Pomógł: 0 Dołączył: 30.11.2004 Ostrzeżenie: (0%) ![]() ![]() |
ni e includuj po http
![]() -------------------- |
|
|
![]()
Post
#3
|
|
![]() Grupa: Zarejestrowani Postów: 999 Pomógł: 30 Dołączył: 14.01.2007 Skąd: wiesz ? Ostrzeżenie: (0%) ![]() ![]() |
<? include ("http://radiolaguna.nazwa.pl/staty.php"); ?>
Wątpię żebyś go dołączył w ten sposób ... musisz podać systemową ścieżkę dostępu czyli na przykład include('C:\blablabla\staty.php') lub od miejsca gdzie jest skrypt z którego dołączasz umieszczony czyli include('./katalog/staty.php'); od katalogu nadrzędnego include('../staty.php'); Dodatkowo możesz zamienić tagi php ze stylu asp na standardowy bo nie wszystkie serwisy je obsługują czyli zamiast <?, ?> <?php, ?> |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 28.05.2007 Ostrzeżenie: (0%) ![]() ![]() |
kombinuję,kombinuję i nie wychodzi juz brak mi pomysłów
|
|
|
![]()
Post
#5
|
|
![]() Grupa: Zarejestrowani Postów: 108 Pomógł: 2 Dołączył: 9.05.2007 Skąd: INTERNET Ostrzeżenie: (0%) ![]() ![]() |
A chcesz zaincludować skrypt czy to co ten skrypt zwraca. Bo jeżeli sam skrypt to musisz mu zmienić rozszerzenie na przykład na txt. Każde wywołanie skryptu z innego serwera z rozszerzeniem php zwróci Ci wynik a nie skrypt.
-------------------- "There are only 10 types of people in the world: Those who understand binary, and those who don't"
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 28.05.2007 Ostrzeżenie: (0%) ![]() ![]() |
napisałem maila do netart u nich mam wykupiony serwer i pomogli odpisali moze się komuś przydać:
Domyślnie pliki html są traktowane jako HTML, więc skrypty PHP w nich są ignorowane. Za pomocą pliku .htaccess z następującą zawartością: RemoveHandler .html AddType application/x-httpd-php .html Zmieniłem by były traktowane jako PHP. Potem zmiana ścieżki na staty/staty.php i wygląda na to, że działa. dziękuję wszystkim na tym forum za odpowiedzi i udzieloną pomoc i pozdrawiam serdecznie |
|
|
![]() ![]() |
![]() |
Aktualny czas: 21.08.2025 - 02:32 |