View Full Version : Pinger.php CODE
308holes
September 21st, 2001, 03:12
some one gave me a PHP code that pings site i lost the code and i cant find it on this site anymore can who ever made it post it again please
308holes
September 21st, 2001, 20:57
any one?
niv
September 22nd, 2001, 10:06
system("ping $host");
:confused:
308holes
September 22nd, 2001, 13:22
ok I found the code but it dosent work?
<?php
// This script was writen by webmaster@theworldsend.net, Aug. 2001
// <a href="http://www.theworldsend.net" target="_blank">http://www.theworldsend.net</a>
// This is my first script. Enjoy.
//
// Put it into whatever directory and call it. That's all.
//
//-------------------------
$max_count = "10"; //maximum count for ping command
// -------------------------
//
// nothing more to be done.
If ($submit =="Ping!") {
If ($count > $max_count) {
echo 'Maximum for count is '.$max_count;
echo '<a href="php-ping.php">Back</a>';
$again = True;}
else {
If (ereg(" ",$host)) {
echo 'No Space in Host field allowed !';
echo '<a href="php-ping.php">Back</a>';
$again= True;}
else {
echo("Ping Output:<br>");
exec("/bin/ping -n $count $host", $list);
sleep($count + 1);
for ($i = 0; $i < count($list); $i++)
print $list[$i]."<br>"; }}}
else {
echo '
<html><body>
<form methode="post" action="php-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>';}
?>
ashben
September 23rd, 2001, 03:18
Originally posted by 308holes
ok I found the code but it dosent work?
<?php
:
:
exec("/bin/ping -n $count $host", $list);
:
:
Are you sure the path to PING is /bin/ping?
308holes
September 23rd, 2001, 14:05
lol no i just changed that and its not working
<?php
// This script was writen by webmaster@theworldsend.net, Aug. 2001
// <a href="http://www.theworldsend.net" target="_blank">http://www.theworldsend.net</a>
// This is my first script. Enjoy.
//
// Put it into whatever directory and call it. That's all.
//
//-------------------------
$max_count = "4"; //maximum count for ping command
// -------------------------
//
// nothing more to be done.
If ($submit =="Ping!") {
If ($count > $max_count) {
echo 'Maximum for count is '.$max_count;
echo '<a href="ping.php">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>");
exec("Ping -n $count $host", $list);
sleep($count + 1);
for ($i = 0; $i < count($list); $i++)
print $list[$i]."<br>"; }}}
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>';}
?>
308holes
September 26th, 2001, 02:04
please help me!!
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.