Buenas noches
Me gustaría saber si es posible hacer que esto funcione.
Código:
[IMG_]https://sorienrot.es/stats.php?ip=149.202.65.171&port=30120[/IMG_] Mal escrito para que no lo detente, pero la esta debajo de esto el real
AQUI ⬇

AQUI ⬆
La idea es poder usarlo en foros, teamspeak y demás, para que lo detecten como una imagen en si
El código es muy básico
Código PHP:
<?php /*
*/
$ip = $_GET["ip"];
$port = $_GET["port"];
$estilo = $_GET["estilo"];
$urlon = $_GET["urlon"];
$urloff = $_GET["urloff"];
if (isset($_GET["ip"]))
{
if (isset($_GET["port"]))
{
if (isset($_GET["urloff"]))
{
if (isset($_GET["urlon"]))
{}
else
{
echo '<script language="javascript">';
echo 'alert("No has indicado la url de encendido. Ejemplo = stats.php?ip=14...14&port=...&urlon=URL_Propia")';
echo '</script>';
echo '<script>';
echo 'window.history.back()';
echo '</script>';
}
}
if (isset($_GET["urlon"]))
{
if (isset($_GET["urloff"]))
{}
else
{
echo '<script language="javascript">';
echo 'alert("No has indicado la url de apagado. Ejemplo = stats.php?ip=14...14&port=...&urloff=URL_Propia")';
echo '</script>';
echo '<script>';
echo 'window.history.back()';
echo '</script>';
}
}
if (isset($_GET["urlon"], $_GET["urloff"]))
{
/*Con urls*/
$imgfon = "$urlon";
$imgfoff = "$urloff";
function pingDomain($domain, $puerto)
{
$starttime = microtime(true);
$file = @fsockopen ($domain, $puerto, $errno, $errstr, 10);
$stoptime = microtime(true);
$status = 0;
if (!$file) $status = -1; // Site is down
else
{
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
if ($status <> -1)
{
return true;
}
return false;
}
if (pingDomain($ip, $port))
{
echo '<img src="'.$imgfon.'">';
}
else
{
echo '<img src="'.$imgfoff.'">';
}
/*Fin Con urls*/
}
else
{
/*Inicio estilos estilos*/
if (isset($_GET["estilo"]))
{
if($_GET["estilo"] == 1)
{
$imgfon = "/imagenes/estilo1on.png";
$imgfoff = "/imagenes/estilo1off.png";
}
else
{
if($_GET["estilo"] == 2)
{
$imgfon = "Imagen_2_on";
$imgfoff = "Imagen_2_off";
}
else
{
if($_GET["estilo"] == 3)
{
$imgfon = "Imagen_3_on";
$imgfoff = "Imagen_3_off";
}
else
{
if($_GET["estilo"] == 4)
{
$imgfon = "Imagen_4_on";
$imgfoff = "Imagen_4_off";
}
else
{
if($_GET["estilo"] == 5)
{
$imgfon = "Imagen_5_on";
$imgfoff = "Imagen_5_off";
}
}
}
}
}
}
else
{
/* Imagen estandar vacia */
$imgfon = "/imagenes/on.png";
$imgfoff = "/imagenes/off.png";
}
function pingDomain($domain, $puerto)
{
$starttime = microtime(true);
$file = @fsockopen ($domain, $puerto, $errno, $errstr, 10);
$stoptime = microtime(true);
$status = 0;
if (!$file) $status = -1; // Site is down
else
{
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
if ($status <> -1)
{
return true;
}
return false;
}
if (pingDomain($ip, $port))
{
echo '<img src="'.$imgfon.'">';
}
else
{
echo '<img src="'.$imgfoff.'">';
}
/*Final estilos*/
}
}
else
{
echo '<script language="javascript">';
echo 'alert("No has indicado el puerto. Ejemplo = stats.php?ip=14...14&port=12345")';
echo '</script>';
echo '<script>';
echo 'window.history.back()';
echo '</script>';
}
}
else
{
echo '<script language="javascript">';
echo 'alert("No has indicado la ip. Ejemplo stats.php?ip=123.123.123.123")';
echo '</script>';
echo '<script>';
echo 'window.history.back()';
echo '</script>';
}
?>
Quien pueda ayudarme se lo agradecería mucho.