Jump to content

Recommended Posts

<?php

// SET ALL CONFIG VALUES

$kick_password 		= "kick";
$timeout		= 5;			// SECONDS TO WAIT FOR CONNECTION


$shoutcast_ip		= array("panel1.shoutcast.pro");
$shoutcast_name		= array("High Band");	
$shoutcast_port		= array("8060");
$shoutcast_password	= array("pass");

if($_SERVER ['PHP_AUTH_PW'] != "$login_password") {
header('WWW-Authenticate: Basic realm="SHOUTcast | KICK SOURCE"');
header('HTTP/1.0 401 Unauthorized');
echo '<html><head><title>Kick On Air DJ</title></head><body bgcolor="#C6E2FF" text="black">';
echo '<h1>Kick On Air DJ<hr width="100%" size="1" color="black" noshade></h1>';
echo '<font face="Verdana" size="3" color="red"><b>Authorisation failed</b></font><br>';
echo '<font face="Verdana" size="2"><b>Reload this page and <a href="'.$_SERVER['PHP_SELF'].'" style="color: black;">try login again</a></b></font></body></html>';
exit; }  ?>

<html>
<head>
<title>Staff - Kick Our On Air DJ</title>
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<style>
td {
  border:1px black solid; }
font { font-family: Verdana; }
</style>
</head>

<body bgcolor=" #000000" text="#2698BD">

<h1>Kick the On Air DJ

<hr width="100%" size="1" color="#2698BD" noshade></h1>

<font size="2">Select stream:</font>
<form method="get" style="margin: 0px;">
<select name="id" style="border: 1px solid black;">
  <option value="0">>> Please choose</option>
  <?php
    $id = $_REQUEST['id'];

    if(!isset($_REQUEST['id']) || $id == '') $id = 0;

    for($x=0;$x<count($shoutcast_ip);$x++) {
     if($x == $id) echo "  <option value=\"$x\" selected>".$shoutcast_name[$x]." | ".$shoutcast_ip[$x].":".$shoutcast_port[$x]."</option>\n";
     else echo "  <option value=\"$x\">".$shoutcast_name[$x]." | ".$shoutcast_ip[$x].":".$shoutcast_port[$x]."</option>\n";
    }
  ?>
</select>
<input name="send2" type="submit" value=">> Select!" style="border: 1px solid black;">
</form>
<br>

<?php

$kickit = $_POST['password_kick'];

if(isset($_POST['send'])) {

  if($kickit != "$kick_password") {

    $mess = "Password wrong. On air DJ not kicked";
    $col  = "red";

   echo "<table width=\"400\" cellpadding=\"2\">
 <tr>
  <td width=\"100%\" bgcolor=\"$col\"><font size=\"2\"><b>Notice</b></font></td>
 </tr>
 <tr>
  <td width=\"100%\" bgcolor=\"white\" height=\"60\"><font size=\"2\">$mess</font></td>
 </tr>
</table><br>";
  echo "<meta http-equiv=refresh content=4;URL=".$_SERVER['PHP_SELF']."?id=$id>"; }

  else {

   if($_POST['kick_all'] ==  'true') { $start = 0; $end  = count($shoutcast_ip); }
   else  { $start = $id; $end  = $start+1; }

   for($s=$start;$s<$end;$s++)
   {

    $fp = @fsockopen($shoutcast_ip[$s], $shoutcast_port[$s], &$errno, &$errstr, $timeout);

    if ($fp) {
     $mess = "On air DJ <b>".$shoutcast_ip[$s]."</b> successfully kicked.";
     $col  = "green";

     @fputs($fp,"GET /admin.cgi?pass=".$shoutcast_password[$s]."&mode=kicksrc HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
     @fclose($fp); }
    else {
     $mess = "Connection parameters wrong. Source <b>".$shoutcast_ip[$s]."</b> not kicked.";
     $col  = "red"; } 

   echo "<table width=\"400\" cellpadding=\"2\">
 <tr>
  <td width=\"100%\" bgcolor=\"$col\"><font size=\"2\"><b>Notice</b></font></td>
 </tr>
 <tr>
  <td width=\"100%\" bgcolor=\"white\" height=\"60\"><font size=\"2\">$mess</font></td>
 </tr>
</table><br>";
  } // END FOR
  echo "<meta http-equiv=refresh content=4;URL=".$_SERVER['PHP_SELF']."?id=$id>";
}  
}

?>

<li><font size="2"><b>Service description</b><br>This service is used to kick DJ via webclient</font>

<li><font size="2"><b>Source details</b></font><br>
<?php
$fp = @fsockopen($shoutcast_ip[$id], $shoutcast_port[$id], &$errno, &$errstr, $timeout);
if($fp) {
  fputs($fp,"GET /admin.cgi?pass=".$shoutcast_password[$id]." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
  while(!feof($fp)) { $cont .= fgets($fp, 128); }
  $cont = strip_tags($cont);
  if(ereg("Power Jammin' Radio is currently down", $cont)) { echo "<font size=\"2\"><font color=\"red\">Power Jammin' Radio is down/</font> >> Kickin' source has <b>no</b> effect</font>"; }
  elseif(ereg("Server is currently up", $cont)) { echo "<font size=\"2\"><font color=\"green\">Station is Live!</font> >> Kickin' On Air DJ has effect</font>"; }
  else { echo "<font size=\"2\" color=\"red\">Unknown server/source status</font>"; }
   }
else  echo "<font size=\"2\" color=\"red\"></font>";
?>



<li><font size="2"><b>Kick the On Air DJ Now!</b><br>Enter password and click "Kick the On Air DJ Now!" to Kick the On Air DJ:</font><br>

<form method="post" style="margin: 0px;">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="checkbox" name="kick_all" value="true" checked style="border: 1px solid black;"><font size="1">Kick the On Air DJ Now!</font><br>
<input type="password" name="password_kick" style="border: 1px solid black;">
<input type="submit" value=">> Kick the On Air DJ Now!" name="send" style="border: 1px solid black;">
</form>
</body>

</html>

What is the error output? Can you paste it please.

 

 

Your use of arrays is sort of defeating the true purpose of an actual array. You are also looping through nothing but 1 key of your arrays. You can just put your connection params into strings.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.