Dyskusja: pinger
Podgląd pojedynczego posta
Stary 12.01.2003, 12:37   #5
+++LeWaP+++
Guru
 
Avatar użytkownika +++LeWaP+++
 
Data rejestracji: 17.04.2002
Lokalizacja: Kłodzko
Posty: 2,534
+++LeWaP+++ zaczyna zdobywać reputację <1 - 49 pkt>
nie wiem może to się przyda -> skrypt cgi na strone www, chyba loguje wyniki... sprawdź

=**************************************
= Name: ping.pl
= Description:When linked to a form on a
= webpage (forn code is included in source
= , just cut and paste), a surfer can ente
= r an IP and check if that host is alive.
=
= By: Jerry Lawson
=
= Returns:Returns the ping results.
=
= Assumes:The code was written for use w
= ith Microsofts IIS. It is easily modifia
= ble though to use with a Linux or Unix p
= latform. If you don't know how to modify
= it, e-mail me at jlawson7@adelphia.net.
=
=This code is copyrighted and has = limited warranties.Please see http://w
= ww.Planet-Source-Code.com/xq/ASP/txtCode
= Id.365/lngWId.6/qx/vb/scripts/ShowCode.h
= tm =for details. =**************************************

#!c:\perl\bin\perl.exe -w
#Script allows people to ping an ip address from a webpage.
#Allows surfers to see if a server is alive.
#Code by Jerry Lawson
#This code can be used by anyone, just leave these lines
#giving me credit.
#Written for use with Microsoft IIS
################################################## ############
#Cut and paste the following html and place it in your webpage
#<form name="ping" action="scripts/ping.pl" method="GET">
#<input type="text" name="ip" size="30"><br>
#<input type="submit" value="PING">
#</form>
################################################## ############
use strict;
use CGI ':standard';
my ($ip, @results, $i);
$ip = param('ip');
system("ping $ip > ping.log");
open(LOG,"<ping.log");
@results = <LOG>;
close(LOG);
print "Content-type: text/html\n\n";
foreach $i (@results){
print "$i<br>";
}
__________________
lewap3@tlen.pl
+++LeWaP+++ jest offline   Odpowiedz cytując ten post