hello webmasters
How do I get the IP address of the visitors who are coming to my website.
thanks in advance
Regards
Arun
| SitePoint Sponsor |
hello webmasters
How do I get the IP address of the visitors who are coming to my website.
thanks in advance
Regards
Arun

You'll need to look at the site logs on the server.
Why does it matter?
What server-side lanaguage is in use? eg php, asp, .net etc
Community Team Advisor
Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator
Site logs, or just put statcounter.com on your site
StatCounter is good analytics tool, you can see visitors ip address on it.

Whats the matter with the ip address. Knowing the region is more than enough for a good webmaster rather than viewing individual ip address. Few service providers keep on change their ip's. Try using Google Analytics. It will help you.
You need to write a php script to detect the IP address and obtain the ISP from that. Then you need your own ip-to-country database on your own site and look up the ip there and build your message accordingly. There are some free ip-to-country databases on the net that you can download data from and maintain your own database with that data. No such free ones for more detailed geo-location data though.
use statcounter.com it helps to know the ip address,country name ,visited date ,visited URL and etc..
Register to StatCounter.com, install the script then go to Recent Pageload Activity it will show you detailed reports of the visits including each visit ip.
Personally I find StatCounter much better then GA, or I just got used with it.










$_SERVER is the array name.
if you haven't already clicked the link to the php manual's explanation, click it and hopefully all will be explained..
Use $_SERVER['REMOTE_ADDR'] to log into a text file.


You can use this to get the visitor's IP address!
Code html:<form action="saveip.php" id="ip-form" method="post"> <fieldset> <label> What is your IP address: <input type="text" name="ip" id="ip" value="" /> </label> <input type="submit" value="Send IP Address" /> </fieldset> </form>
There are ways of doing it in javascript, but they are not recommended and are not very reliable. To be honest, I think OPs best bet is to use some sort of web widget.





I know this is quite an old thread, but I wonder If you understood the question right? You suggest that someone types in his/her IP Address, but I think the intention of the question was how to get the IP address from people visiting the site without them entering the actual address
Donboe, I certainly understand the question, I was just being mean![]()
Bookmarks