How to create reverse traceroute page on your website using PHP

<?php
$result = exec('traceroute ' . $_SERVER["REMOTE_ADDR"], $lines);
echo '<h1>Your IP is ' . $_SERVER["REMOTE_ADDR"] . '</h1>';
echo '<pre>';
foreach ($lines as $n => $line) {
	if ($n) echo '<br />';
	echo $line;
}
echo '</pre>';
echo '<p>-end-</p>';

Here’s how the resulting page looks like: reverse-traceroute.php

About Raymond

I'm a Christian web developer from the Philippines. Sometimes I write also.
This entry was posted in Linux Administration, PHP, Programming and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>