
14/07/2010, 12:29
|
| | Fecha de Ingreso: julio-2010
Mensajes: 2
Antigüedad: 14 años, 8 meses Puntos: 0 | |
ayuda con estos codigos en php saben necesito analizar unos codigos solo kiero saber que es lo que hacen estas lineas si alguien me puede ayudar se lo agradeceria eternamente, yap los codigo son los siguientes:
$max_count = 10; //maximum count for ping command
$unix = 1; //set this to 1 if you are on a *unix system
$windows = 0; //set this to 1 if you are on a windows system
$register_globals = (bool) ini_get('register_gobals');
$system = ini_get('system');
$unix = (bool) $unix;
$win = (bool) $windows;
If ($register_globals)
{
$ip = getenv(REMOTE_ADDR);
$self = $PHP_SELF;
}
else
{
$submit = $_GET['submit'];
$count = $_GET['count'];
$host = $_GET['host'];
$ip = $_SERVER['REMOTE_ADDR'];
$self = $_SERVER['PHP_SELF'];
};
If ($submit == "Ping!")
{
// over count ?
If ($count > $max_count)
{
echo 'Maximum for count is: '.$max_count;
echo '<a href="'.$self.'">Back</a>';
}
else
{
// replace bad chars
$host= preg_replace ("/[^A-Za-z0-9.]/","",$host);
echo '<body bgcolor="#00ff00" text="#000000"></body>';
echo("Ping Output:<br>");
echo '<pre>';
//check target IP or domain
if ($unix)
{
system ("ping -c$count -w$count $host");
system("killall ping");// kill all ping processes in case there are some stalled ones or use echo 'ping' to execute ping without shell
}
else
{
system("ping -n $count $host");
}
echo '</pre>';
}
}
else
{
echo '<body bgcolor="#0f0f0f0f" text="#000000"></body>';
echo '<p><font size="2">Tu IP es: '.$ip.'</font></p>';
echo '<form methode="post" action="'.$self.'">';
echo ' Ingresar IP o Servidor <input type="text" name="host" value="'.$ip.'"></input>';
echo ' Ingresar contador <input type="text" name="count" size="2" value="4"></input>';
echo ' <input type="submit" name="submit" value="Ping!"></input>';
echo '</form>';
echo '<br><b>'.$system.'</b>';
echo '</body></html>';
}
?>
yap esos son los codigos
lo necesito lo antes posible desde ya muchas gracias.... |