moze li neko slijedeci kod u php-u izdebagirati i doci do rijesenja ovog programa i novi kod atacirati kao rezultat ?? Zapelo je kod ove naredbe fsockopen ....
Unaprijed Hvala
<?php
// Fill in your own server information here:
$host = "http://195.222.33.217";
$port = "8012";
$listenlink = 'http://195.222.33.217:8012/'; //make link to stream
$fp = @fsockopen($host, $port, $errno, $errstr, 30); //open connection
if(!$fp) {
$success=3; //se-t if no connection
}
if($success!=2){ //if connection
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n"); //get 7.html
//echo $success;
while(!feof($fp)) {
$page = fgets($fp, 1000);
}
fclose($fp); //close connection
$page = ereg_replace(".*", "", $page); //extract data
$page = ereg_replace(".*", ",", $page); //extract data
$numbers = explode(",",$page); //extract data
$currentlisteners=$numbers[0]; //set variable
$connected=$numbers[1]; //set variable
echo $numbers;
}
if($connected==1){ //if DSP is connected
$wordconnected="yes";
echo $wordconnected;
}
//set variable
else { //if no DSP connection
$wordconnected="no"; //set variable
$peaklisteners=$numbers[2]; //set variable
$maxlisteners=$numbers[3]; //set variable
$reportedlisteners=$numbers[4]; //set variable
echo $wordconnected;
}
if($success!=2 && $connected==1){
// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
$song=explode(" - ",$numbers[6]);
// strings can of course be replaced with your own bla
$string1= "Now playing on http://195.222.33.217:8081/ ::: ";
$string2= $song[0];
$string3= $song[1];
$string4= $song[2];
$string5= "[$currentlisteners/$maxlisteners users]";
$string6= "Listener Peak";
}
else {
$string1= "The music station is";
$string2= "OFFLINE. ";
$string3= "Please return later. ";
$string4= " ";
$string5= " ";
}
echo $string1;
echo $string2. " ";
echo $string3. " ";
echo $string4. " ";
echo $string5. " ";
?>