Solved

get info for visitors

Posted on 2012-03-26
8
296 Views
Last Modified: 2012-04-24
Dear,
When u go to sites like http://www.hide-my-ip.com/, the site shows your IP, Location  and ISP provider.
How can I do that in asp.net/php, and what other information of visitors can I get too?
Thx
0
Comment
Question by:hassanayoub85
8 Comments
 
LVL 1

Expert Comment

by:DrMadAxe
Comment Utility
That is a GET function I believe.

Here is a good article:

http://wiki.jumba.com.au/wiki/PHP_Get_user_IP_Address

Also you will need to echo the variable once set up and use print to display it on the screen.

Hope that helps.
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
Comment Utility
0
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
you need to either Sotre Cisty/State data broken down by IP into your Database...or you can use API's to get City State Data based upon IP..

I used following Service to get User Data:
http://www.maxmind.com/app/geolitecity
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Run this script and look near the bottom.  You can get the client browser and IP address.
<?php phpinfo();

Open in new window

Once you have the IP address, you can make an educated guess about the location.  See this article for more: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_3437-IP-Address-to-Country-in-PHP.html

You can get a more refined view of the client location by using one of the web services like this one: http://www.geoio.com/

I used the GEOIO service to get the IP-to-location information used to draw the map on this page.  
http://www.landonbaseball.com/site_visitors.php
Something interesting to note... The locations are not precise and though the site has had thousands of visitors, only a few hundred locations are mapped.  That is because the IP address is mapped to the location of the Internet Point of Presence.  Where I live in McLean, VA, there are thousands of people whose IP addresses all point to the same internet terminus.

HTH, ~Ray
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 7

Expert Comment

by:designatedinitializer
Comment Utility
get the user's IP address in PHP:
echo $_SERVER['REMOTE_ADDR'];

Open in new window

location services... I already posted about that here:
http://www.experts-exchange.com/Networking/Protocols/Transport/TCP-IP/Q_27657512.html
0
 

Author Comment

by:hassanayoub85
Comment Utility
Ok for country, what about other information of visitors can I get too?
I see that I can get the user-agent info, possible nat ip, hostname, request, referrer, and browser language used.
Any other info can I grab?
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
If you join an advertising network like DoubleClick or UnderTone you will find all kinds of good information at very low cost.
0
 

Author Comment

by:hassanayoub85
Comment Utility
Sorry but what is that? didn't understood!!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now