Don't work the number of listeners in Php

Discuss Shoutcast streaming here, any issues, advice or tips are welcome
Forum rules
Please don't use the forums to report outages, particularly if you are a FreeStreamHosting.org user.

Don't work the number of listeners in Php

Postby nept1 » Wed 22nd Jun, 2011 6:59 am

Dont work the php code to view the number of listeners

$ip = "XXX.XXX.XXX.XXX";
$port = "XXXXX";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
$listeners = "0";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$split = explode(',', $info);
if ($split[1] == "0" )
{
$listeners = "0";
}
else
{
$listeners = $split[0];
}
}
echo $listeners;
nept1
 
Posts: 2
Joined: Wed 22nd Jun, 2011 6:56 am

Re: Don't work the number of listeners in Php

Postby Gavin » Mon 27th Jun, 2011 5:26 pm

It sounds like you need to contact your host and ask them to allow outgoing connections to the Shoutcast server. This is a common security feature that many webhosts use (blocking outgoing connection).
Please don't PM me for support, support system located at:
Customer Support: https://secure.bellonline.co.uk/submitticket.php
FreeStreamHosting Support: http://freestreamhosting.org/support.php
Sales: https://secure.bellonline.co.uk/contact.php
Gavin
Site Admin
 
Posts: 387
Joined: Thu 01st Jan, 1970 1:00 am


Return to Streaming Discussion

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests