Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

lookup.php

By: NullSet on Aug 1st, 2011  |  syntax: PHP  |  size: 0.84 KB  |  hits: 124  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!-- This is a simple resolver designed for local use                                           -->
  2. <!-- Not advised to be put on any site without adding some security features-->
  3. <!-- Coded by Null Set (1 Aug 2011)                                                                                     -->
  4. <!-- Submitted originally to securityoverride.com                                                       -->
  5.  
  6.  
  7. <?php
  8. if(isset($_POST['ip'])){
  9.         $ip = $_POST['ip'];
  10.         $hostname_result = gethostbyaddr($ip);
  11.         echo $ip." has hostname ".$hostname_result."<br /><br />";
  12. }
  13. if(isset($_POST['addr'])){
  14.         $addr = $_POST['addr'];
  15.         $ip_result = gethostbyname($addr);
  16.         echo $addr." has IP ".$ip_result."<br /><br />";
  17. }
  18. ?>
  19.  
  20. <form action='' method='POST' name='ip'>
  21.         IP Address to check: <input type='text' name='ip' /><input type='submit' value='Submit!' />
  22. </form>
  23. <form action='' method='POST' name='addr'>
  24.         Hostname to check: <input type='text' name='addr' /><input type='submit' value='Submit!' />
  25. </form>