fortypoundhead.com

How to Get the IP Address of Website Visitors

Posted On 2013-09-02 by dwirch
Keywords:
Tags: Scripting Tutorial Webmaster Related 
Views: 591


Now, now. I know most of you are pretty seasoned veterans of technology, and some of you are even top-notch developers. Would you believe someone out there is selling this, though?

Yes, I know. On a particular forum for webmasters and SEO-type folks that I frequent, I saw a marketplace post for a script for sale. The script provided the functionality of revealing the IP address of visitors of your website. And what was he charging for this free information ? Eleven US dollars.

WTF?!

Yep, this guy actually has the chutzpah to attempt to charge people for free information. Well, you know I can't just let that stand. So, I'm going to show you how.

Why Should I Know the IP Address of Visitors?

Well, in all honesty, there is no real reason for you as a webmaster to know this information. The only time you'd need to know is if you get a subpoena from legal authorities for an investigation. And then their going to ask for your log files, filtered by a specific IP address.

But lets say you're building your own analytics type engine. Or maybe you want to watch for a certain IP address to pop up on your site. Maybe you might want to kick off a certain chain of events of you get a hit from a particular netblock.

Most of time, these scripts are used for "What's My IP Address?" type pages. Heck, fortypoundhead.com has one, located here.

So here is the code. All one line of it. Just for kicks, two different language interpreters.

PHP

$ip=$_SERVER['REMOTE_ADDR'];

ASP

<% =Request.ServerVariables("REMOTE_ADDR") %>
Easy, huh?

Now don't go paying money for information that is free. Use your favorite search engine, and save some cash. You can buy me a beer next time you are in town.


About the Author

dwirch has posted a total of 172 articles.

 


Comments On This Post

By: dwirch
Date: 2013-09-05

Umm, yeah. You guys who are emailing me to thank me for the informative post. Well, you might want to take the title "Web Developer" out of your signature line.

If you don't have knowledge of this basic information, you are doing your clients a severe disservice.


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.211.127.89

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

Job Spammer: Sathya Narayana
dwirch posted on March 15, 2017 at about 7:18 in Spammers

Job Spammer: Manish Kumar
dwirch posted on March 14, 2017 at about 17:44 in Spammers

Site Migration Complete
dwirch posted on March 12, 2017 at about 11:10 in Site News

Site Migration Complete
dwirch posted on March 11, 2017 at about 0:35 in Site News

Job Spammer: Jason Weinstein
dwirch posted on March 10, 2017 at about 14:00 in Spammers

Job Spammer: Ryan Wilson
dwirch posted on March 8, 2017 at about 17:00 in Spammers