Solved

get info for visitors

Posted on 2012-03-26
8
300 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:Saqib Khan
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 109

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
 
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 109

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help in good tutorials for PHP, HTML and CSS 6 41
issue with DB import 1 19
PHP 5.6 and 7.x 4 23
form validation - make sure at least 1 checkbox is selected 18 30
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

831 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