U
User0
Gast
Guten Abend liebe Leute, ich brauche mal eine Info darüber was ich falsch mache oder denke. Vielleicht ist es auch garnicht möglich (denke ich eher) oder es ist irgend etwas was man sehen sollte (denke ich weniger).^^
Erklärung: Rufe ich die Seite direkt auf (www.xxx.de/diese.php) dann klappt es!
Aber.... Rufe ich sie (wo es soll) im Login auf (www.xxx.de/xxx/xxx/user.php?site=diese) auf dann kommt einige fehlermeldungen:
Notice: Undefined index: PHP_AUTH_USER in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 22
Notice: Undefined index: PHP_AUTH_PW in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 22
Notice: Undefined index: password_kick in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 45
Notice: Undefined variable: cont in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 105
Was muss wo geändert werden grrr...
LG Screamdad

Erklärung: Rufe ich die Seite direkt auf (www.xxx.de/diese.php) dann klappt es!
Aber.... Rufe ich sie (wo es soll) im Login auf (www.xxx.de/xxx/xxx/user.php?site=diese) auf dann kommt einige fehlermeldungen:
Notice: Undefined index: PHP_AUTH_USER in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 22
Notice: Undefined index: PHP_AUTH_PW in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 22
Notice: Undefined index: password_kick in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 45
Notice: Undefined variable: cont in /var/www/web4/html/xxx/xxx/xxx/diese.php on line 105
Was muss wo geändert werden grrr...
LG Screamdad
PHP:
<?php
$login_user = "";
$login_password = "";
$kick_password = "admin";
$timeout = 5;
$shoutcast_ip = array("127.0.0.2", "127.0.0.2");
$shoutcast_name = array("Hauptstream", "Teststream");
$shoutcast_port = array("8000", "8010");
$shoutcast_password = array("pw1", "pw2");
if($_SERVER['PHP_AUTH_USER'] != "$login_user" || $_SERVER['PHP_AUTH_PW'] != "$login_password") {
echo '<meta http-equiv="refresh" content="0;URL="../../403.php">';
exit; } ?>
<font size="2">Wähle hier deinen Stream aus:</font><br><br>
<form method="get" style="margin: 0px;">
<select style="border: 1px solid black; border-color: #414141; color: #ADC8E3; background: #414141" name="id">
<?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><br><br>
<input onfocus="this.blur()" type="submit" name="send2" value="Auswählen" style="width: 90px;">
</form>
<br>
<?php
$kickit = $_POST['password_kick'];
if(isset($_POST['send'])) {
if($kickit != "$kick_password") {
$mess = "Password wrong. Source(s) 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 = "Source <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 Information:</b><br>Dieser Service wird verwendet,<br>um Ihre Shoutcast Quelle über den WebClient zu Kicken!</font><br><br>
<li><font size="2"><b>Stream Information:</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("Server is currently down", $cont)) { echo "<font size=\"2\"><font color=\"#FF8C00\">Der Server ist Offline und der Stream nicht in Betrieb!</font><br>Das Kicken hat <b>kein</b> Effekt!</font>"; }
elseif(ereg("Server is currently up", $cont)) { echo "<font size=\"2\"><font color=\"#7CFC00\">Der Server ist Online und der Stream in Betrieb!</font><br>Das Kicken hat <b>einen</b> Effekt!</font>"; }
else { echo "<font size=\"2\" color=\"#FF0000\">Unbekannter Status von Server und Stream!</font>"; }
}
else echo "<font size=\"2\" color=\"#FF0000\">Keine Verbindung zum Server und Stream möglich!</font>";
?>

Zuletzt bearbeitet von einem Moderator: