Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I find the clients IP Address who visited my web sites
plz any one help me help in this problem


[Digimanus: removed shouting]
Posted
Updated 12-Mar-12 0:57am
v2

Finding the client IP address is actually quite problematic. The best you could really hope for is code that might get the router address, or proxy IP address. Anyway, assuming you are using jQuery, you could use something like this:
JavaScript
$(document).ready( function() {
  $.getJSON("http://smart-ip.net/geoip-json?callback=?",
    function(data) {
      // do something with data.host (which contains the ip info).
  });
});
 
Share this answer
 
read this[^]!
 
Share this answer
 
Method 1: Using Client side Scripts like solution 1
Method 2: Using server side code:
1- Request.UserHostAddress
2- Request.ServerVariables[REMOTE_ADDR].ToString()
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900