943,907 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 675
  • PHP RSS
Jul 20th, 2008
0

Help me with this please!!!

Expand Post »
I am making a whatsmyip.org clone and this is what I have so far
PHP Syntax (Toggle Plain Text)
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Maddog's IPs'</TITLE>
  4. <META NAME="Keywords" CONTENT="IP, address, find ip address, ip addres, whats ip, ip find, ipconfig, ipaddress">
  5. <META NAME="Description" CONTENT="Maddog's IP' - The #1 Way To Find Your IP Address !">
  6. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  7. <LINK TITLE="" HREF="ip.css" TYPE="text/css" REL="stylesheet">
  8. </HEAD>
  9. <body>
  10. <div align="center">
  11. <SCRIPT TYPE="text/javascript"><!--
  12. doad2();
  13. //--></SCRIPT>
  14. <table class="maintable" align="center" border="1" cellSpacing="0" cellPadding="0">
  15.  
  16. <tr>
  17. <td class="head"><div align="left"><img src="http://www.maddogsprofiles.com/flash/WHITEBAN.jpg" width="885" height="150"></div></td>
  18. <tr>
  19. <td class="ip"><h1 align="center">Your IP Is
  20. <p align="center">
  21. <?php $ip = $_SERVER['REMOTE_ADDR'];
  22. echo "<b>IP Address = $ip</b>"; ?></h1>
  23. <h3 align="center"> <text>You are currently viewing this page in <text/> <map id="browser" ''name="firefox" "name="safari" "name="konqueror" name="internet explorer" name="opera" name="lynx" name="flock" name="netscape navigator" name="mosaic" ></map> <script> document.write( document.getElementById('browser').getAttribute('name')); </script>.
  24. </p>
  25. </td>
  26. </tr>
  27. <tr>
  28. <a href="mailto:webmastermaddog@maddogsprofiles.com" td height="88" class="ad"><img src="ad.gif" width="743" height="87"> </a>
  29. <SCRIPT TYPE="text/javascript"><!--
  30. doad1();
  31. //--></SCRIPT> </td>
  32. <tr>
  33. <td class="body">
  34.  
  35. <h3 align="center">Maddog's IPs' is the fastest and easiest way<br />to determine your IP address.</h3>
  36. <p>
  37. <h3 align="center">
  38. <form action="http://www.google.com/cse" id="cse-search-box">
  39. <div>
  40. <input type="hidden" name="cx" value="013221771976019527881:6kzpwitkmxy" />
  41. <input type="hidden" name="ie" value="UTF-8" />
  42. <input type="text" name="q" size="31" />
  43. <input type="submit" name="sa" value="Search" />
  44. </div>
  45. </form>
  46. <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
  47. Copyright Maddog Noland Programming All Rights Reserved </div></td>
  48. </tr>
  49. </table>
  50. </div>
  51. </BODY>
  52. </HTML>
but I want to get it to show the computer country of origin, and host of the visitors internet like on the "more info" page at whatsmyip.org does anyone know how???
Reputation Points: 10
Solved Threads: 0
Light Poster
maddogsprofiles is offline Offline
29 posts
since Apr 2008
Jul 21st, 2008
0

Re: Help me with this please!!!

To show the origin country, a general way is to lookup into a MySQL database with updated IP country ranges, GeoLite Free is a choice. Some commercial databases provide location even into cities. After this, you can use the country code to get their corresponding flag.

To get WHOIS information there are several PHP classes that perform this function.

User agent and Referral URL is easy obtainable through $_SERVER environment variable. Deviating server load to client processing using Javascript to perform this tasks -like in your code- is always better.
Last edited by Tekmaven; Jul 21st, 2008 at 8:29 pm. Reason: Weird char in post
Reputation Points: 52
Solved Threads: 23
Posting Whiz in Training
martin5211 is offline Offline
271 posts
since Aug 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Displaying in Problem..........
Next Thread in PHP Forum Timeline: what about that probs??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC