•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Trace Route
<?php //visit www.corehackers.com to test it!! // Address error handling. ini_set('display_errors', 1); error_reporting(E_ALL ^ E_NOTICE); // Obtain POST data. $trace_ip_addr = $_POST['trace_ip_addr']; // input // Remove any slashes if Magic Quotes GPC is enabled. if (get_magic_quotes_gpc()) { $trace_ip_addr = stripslashes($trace_ip_addr); } /******************************************************************************/ ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Trace</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="dr0n3" /> <style type="text/css"> body { margin: 0; padding: 10px; background-color: #ffffff; } div.output { margin: 0; padding: 10px; background-color: #eeeeee; border-style: solid; border-width: 1px; border-color: #000000; } </style> </head> <body> <h1>Trace</h1> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p><label for="trace_ip_addr">IP address:</label><br /> <input name="trace_ip_addr" id="trace_ip_addr" type="text" value="<?php echo $_POST['submit'] == 'Trace' ? htmlentities($trace_ip_addr, ENT_QUOTES) : '127.0.0.1'; ?>" size="40" maxlength="15" /></p> <p><input type="submit" name="submit" value="Trace" /></p> </form> <p>Trace may take a while, please be patient.</p> <?php if ($_POST['submit'] == 'Trace') // Form has been submitted. { echo '<div class="output">' . "\n"; if (strlen($trace_ip_addr) <= 15) // Form submission was not spoofed. { if (ereg('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$', $trace_ip_addr)) // Acquired data contains no problems. { // Display result. echo '<pre>' . "\n" . 'traceroute ' . $trace_ip_addr . "\n\n"; system('traceroute ' . $trace_ip_addr); // Trace IP address. echo '</pre>' . "\n" . '<p>Trace complete.</p>' . "\n"; } else // Acquired data contains problems! { echo '<p>Please enter a valid IP address.</p>' . "\n"; } } else // Form submission was spoofed! { echo '<p>An illegal operation was encountered.</p>' . "\n"; } echo '</div>' . "\n"; } ?> <!--http:/www.corehackers.com/ --> </body> </html>
Comments (Newest First)
wonder_laptop | Junior Poster in Training | Jan 6th, 2008
•
•
•
•
Sorry, i forgot to give you my email address:
its wonder_laptop_1@windowslive.com
i reallly really appreciate your help.
its wonder_laptop_1@windowslive.com
i reallly really appreciate your help.
wonder_laptop | Junior Poster in Training | Jan 6th, 2008
•
•
•
•
Sorry, i forgot to give you my email address:
its wonder_laptop_1@windowslive.com
i reallly really appreaciate your help.
its wonder_laptop_1@windowslive.com
i reallly really appreaciate your help.
wonder_laptop | Junior Poster in Training | Jan 6th, 2008
•
•
•
•
Hello,
can you PLEASE put a SIMPLE traceroute code in java.
i googled traceroute but i got a bunch of compicated codes.
im new in networking programming, i want to implement the traceroute command . i already managed to create a network and wrote a program for the laptops to send datagrams to each others.
can you PLEASE give me a code for the traceroute command implmentation?
can you PLEASE put a SIMPLE traceroute code in java.
i googled traceroute but i got a bunch of compicated codes.
im new in networking programming, i want to implement the traceroute command . i already managed to create a network and wrote a program for the laptops to send datagrams to each others.
can you PLEASE give me a code for the traceroute command implmentation?
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)