PHP-Code:
<?
function get_radio_mod($file, $port, $pass, $item) {
$fp = @fsockopen ($file, $port, &$errno, &$errstr, 5);
if (!$fp) {
return 0;
} else {
fputs($fp, "GET /admin.cgi?pass={$pass}&mode=viewxml HTTP/1.1\r\n"
."User-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while (!feof($fp)) {
$xml .= fgets($fp,1024);
}
list(,$xml) = explode("<".strtoupper($item).">",$xml);
list($xml,) = explode("</".strtoupper($item).">",$xml);
fclose($fp);
}
return $xml;
}
$titel = get_radio_mod('essen045.server4free.de', '8000', '********', 'servertitle');
$lines = file("$titel.txt");
$IO = fopen("$titel.txt" , "r");
while( !feof( $IO ) )
{
foreach ($lines as $line_num => $line) {
$XX = fgets($IO, 1000);
$eintrag2 = "#$line_num $XX";
echo '<a href="javascript:set(' .$eintrag2. ')">' .$eintrag2. '</a>';
}
}
fclose($IO);
?>
Hier das dazugehörige JavaScript :
<script language="JavaScript">
function set(Zeichen){
document.Formular.nachricht.value=document.Formular.nachricht.value + Zeichen
}
</script>
Kommentar