LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[Webdev] traceroute back to client

[Webdev] traceroute back to client

Donncha O Caoimh donncha.ocaoimh at tradesignals.com
Tue Sep 19 15:57:13 IST 2000


Did the following yesterday evening:
----------trace.php----------
<?php
 if (isset($GLOBALS["REMOTE_HOST"]) && !empty($GLOBALS["REMOTE_HOST"]))
    $host = $GLOBALS["REMOTE_HOST"];
 else
    if (isset($GLOBALS["REMOTE_ADDR"]) &&
!empty($GLOBALS["REMOTE_ADDR"]))
       $host = $GLOBALS["REMOTE_ADDR"];
$traceroute = "/usr/sbin/traceroute";
$out = "Finding path to $host\n\n";
print "$out<BR>";
for( $t = 1; $t < 4 ; $t++ ) {
  $out = $out. "Attempt $t:\n";
  print "Attempt $t:<BR>";
  print "<PRE>";
  exec( "$traceroute $host", $output );
  $output = implode( "\n", $output );
  print $output;
  flush();
  print "</PRE>";
  $out = $out.$output."\n\n";
  print "<BR>";
}
mail( "admin at somesite.com", "Traceroute from our site for $host", $out
);

----------trace.php----------


Donncha O Caoimh wrote:
> 
> Not wanting to reinvent the wheel, has anyone written or come across
> some php code to traceroute or ping back to the web user and tell them
> about their connection?




More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell