Code: Select all
<?php
$max_count = "10";
$os = "win"; // win or unix
If ($submit == "Ping!") {
If ($count > $max_count)
{
echo 'Maximum for count is '.$max_count;
echo '<a href="$script">Back</a>';
$again = True;
}
else
{
If (ereg(" ",$host))
{
echo 'No Space in Host field allowed !';
echo '<a href="ping.php">Back</a>';
$again = True;
}
else
{
echo("Ping Output:<br>");
echo("<pre>");
$host = escapeshellarg($host);
$count = escapeshellarg($count);
if ($os == "win")
{
system("ping -n $count $host", $list);
}
else
{
system("ping -t $count $host", $list);
};
echo("</pre>");
}
}
}
else
{
echo '
<html><body>
<form methode="post" action="ping.php">
Enter IP or Host <input type="text" name="host"></input>
Enter Count <input type="text" name="count" size="2" value="4"></input>
<input type="submit" name="submit" value="Ping!"></input>
</form>
</body></html>';
}
?>Notice: Undefined variable: submit in d:\apache\htdocs\ping.php on line 6
This happends to all my scripts! (a diffrenent variable & line each time)
I have tryed changing register_globals on and off...
i cant seen to get the script to work!