Solved

get info for visitors

Posted on 2012-03-26
8
298 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
ID: 37769766
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
ID: 37769767
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 37770031
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
ID: 37771722
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37804341
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
ID: 37843775
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
ID: 37843826
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
ID: 37843849
Sorry but what is that? didn't understood!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

932 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

10 Experts available now in Live!

Get 1:1 Help Now