| Visit our Sponsors |
|
|
DEPRECATED! We now have a better version of this script including geolocation at the country level. Click here to go to the new script information page. This script ( myip.pl ) will cease operation no later than January 1st, 2013. Please upgrade to the new one before that date! By including a single line of HTML in any web page you can access a client's IP address from within any JavaScript enabled web browser. Add the following line immediately after the <HEAD> tag in any page: <SCRIPT LANGUAGE="JavaScript" SRC="http://www.searchnc.com/cgi-bin/myip.pl"> </SCRIPT> This will set the JavaScript variable IP to the client's IP address. That's all there is to it. Please note that if the client is behind a firewall or using a proxy server then you will get the IP address of the firewall or proxy server instead of their actual fakenet address. If you really wanted to get creative you could use the script to redirect users from a certain class C IP block to a different page. Here's a short code snippet: <SCRIPT LANGUAGE="JavaScript"> var ndx = IP.lastIndexOf("."); var cblock = IP.substr(0, ndx); </SCRIPT> This script is for your website only! Any other use (like checking if your IP address has changed so you can update a DNS server) is considered abuse and it will be made to cease functioning on a per site basis. If you need DNS updates for your dynamic IP we will be glad to set it up for you at a mere $10.00 US per month. |