Jump to content

Now Playing PHP Help!!


Recommended Posts

Hello, everyone i found this PHP script the other day on this forum! :) i am having some problem trying to get it working! i have done everything needed for it to work, when i add my infomation to the script and upload to my server its not showing anything playing?

 

index.php

 

now-playing.php

<?php/*Now Playing PHP script for SHOUTcastThis script is © MixStream.net 2008Feel free to modify this free script in any other way to suit your needs.Version: v1.1*/ /* ----------- Server configuration ---------- */$ip = "host.host.net";$port = "9999";/* ----- No need to edit below this line ----- *//* ------------------------------------------- */$fp = @fsockopen($ip,$port,$errno,$errstr,1);if (!$fp) { echo "OFF AIR - Tune In At 6pm"; // Diaplays when sever is offline } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $info = str_replace('

Link to comment
Share on other sites

Next time, put in with the

 .. 

, as this is terrible to read, or format it ...

 

Did you change the IP / port number to your set-up?

 

If so, what it the error you are getting?

SCS - Dedicated Bandwidth Servers

Shoutcast / Icecast / Windows Media

Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ

Broadcasting World's Stream Host of the Month

Link to comment
Share on other sites

It seems to work just fine on my test server.....once I cleaned up the layout:

 

index page:

 



<br />

<br />
function updateNowPlaying(){ $.ajax({ url: "./now-playing.php", cache: false, success: function(html){ $("#nowPlaying").html(html); } });}updateNowPlaying();setInterval( "updateNowPlaying()", 10000 );<br />












 

 

now-playing.php:

/*Now Playing PHP script for SHOUTcastThis script is (C) MixStream.net 2008
Feel free to modify this free script in any other way to suit your needs.
Version: v1.1*/
/* ----------- Server configuration ---------- */
$ip = "changeme.com";
$port = "8000";
/* ----- No need to edit below this line ----- */
/* ------------------------------------------- */
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
  echo "OFF AIR - Tune In At 6pm";
  // Diaplays when sever is offline
}
else
{
  fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
  while (!feof($fp))
  {
     $info = fgets($fp);
  }
  $info = str_replace('
', "", $info);
  $split = explode(',', $info);
  if (empty($split[6]) )
  {
     echo "The current song is not available";
     // Diaplays when sever is online but no song title
  }
  else
  {
     $title = str_replace('\'', '`', $split[6]);
     $title = str_replace(',', ' ', $title);
     echo "$title";
     // Diaplays song
  }
}
?>

Link to comment
Share on other sites

  • 5 years later...

Have you found any server error?

 

If you want best audio sharing scripts then this may help you!

 

 

It helped me a lot...Check now best audio sharing script

 

Post edited by GK

reason :

- Don't post 3rd party links into your first post(s)

- Please introduce yourself at this link : https://forums.broadcastingworld.com/forumdisplay.php/99-Introduce-Yourself

- Do not reply to posts of 5+ years old

Edited by GKIye
Post edited by GK
  • Sad 1
Link to comment
Share on other sites

@tarina - you are answering a post that is over 5 years old. I highly doubt that the poster hasn't found a solution by now.

 

Or do you just want to get publicity for your site ?

 

BTW - Welcome to the forums.

SCS - Dedicated Bandwidth Servers

Shoutcast / Icecast / Windows Media

Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ

Broadcasting World's Stream Host of the Month

Link to comment
Share on other sites

@tarina - you are answering a post that is over 5 years old. I highly doubt that the poster hasn't found a solution by now.

 

Or do you just want to get publicity for your site ?

 

BTW - Welcome to the forums.

 

Looks like a spammer to me... first post for something that isn't technically broadcasting related.

My Blog https://djgarybaldy.blogspot.com

User of RadioDJ FREE radio playout software since 2010.

How to Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

RadioDJ is my FAVOURITE piece of software it works when I need It

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...