mmmh, non funziona.
vediamo, cerco di spiegarmi meglio perchè sono stato un pò affrettato. copio il codice che ho provato a usare:
Codice PHP:
<?php
header("Contet-type: image/jpeg");
$ipaddr="mio.ip.com";
$port="5121";
$timeout=5;
$connect=@fsockopen("udp://".$ipaddr,$port,$errno,$errstr,$timeout);
if(!$connect)
{
header ("Location:offline.jpg');
exit;
}
else
{
@socket_set_timeout($connect,$timeout);
$send="\xFE\xFD\x00\xE0\xEB\x2D\x0E\x14\x01\x0B\x01\x05\x08\x0A\x33\x34\x35\x13\x04\x36\x37\x38\x39\x14\x3A\x3B\x3C\x3D\x00\x00";
@fwrite($connect,$send);
$output=fread($connect,5000);
if (!$output)
{
header ("Location:offline.jpg');
}
else
{
header ("Location:online.jpg');
}
}
?>
mi da errore:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 /www/status/index_new.php on line 15
Parse error: syntax error, unexpected T_STRING in /www/status/index_new.php on line 15
ps: inoltre vorrei sapere se è possibile usare delle png invece delle jpg