Habe mit folgendem Script ein Problem.
Es kommt immer ein Parse error bei:
Vielleicht weiß ja einer ne Lösung. Danke schonmal.
PHP-Code:
<?php
$ip = "IP";
$port = "PORT";
$pass = "PW";
$song = $_POST['song'];
if (empty($song)) {
$mod = $_POST['mod'];
if (empty($mod)) {
?>
<p>Wähle bitte Hier deinen Streamtitle aus.</p>
<form name="changesong" method="post" action="">
<select name="song" type="text" id="song" value="">
<option>TEXT1</option>
<option>TEXT2</option>
<option>TEXT3</option>
</select>
<select name="mod" type="text" id="mod" value="">
<option>TEXT1</option>
<option>TEXT2</option>
<option>TEXT3</option>
</select>
<input type="submit" name="Submit" value="Speichern">
</form>
<?php
} else {
$song = urlencode($song);
$mod = urlencode($mod);
$song = str_replace("+", "%20", $song);
$mod = str_replace("+", "%20", $mod);
$fp = @fsockopen($ip,$port,$errno,$errstr,4);
if (!$fp) {
print "Error: cant get server, please check that server is online";
} else {
fputs($fp, "GET /admin.cgi?pass=" . $pass . "&mode=updinfo&song=" . $song . - . $mod . " HTTP/1.0\r\n");
fputs($fp, "User-Agent: Mozilla\r\n\r\n");
fclose($fp);
$song = str_replace("%20", "+", $song);
$mod = str_replace("%20", "+", $mod);
$song = urldecode($song);
$mod = urldecode($mod);
print "<strong>Streamtitle wurde geupdated</strong><p>$song - $mod</p>";
}
}
?>
PHP-Code:
fputs($fp, "GET /admin.cgi?pass=" . $pass . "&mode=updinfo&song=" . $song . - . $mod . " HTTP/1.0\r\n");
Kommentar