Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 13, 2012 09:41 AM by khoaofgod
Member
315 Points
79 Posts
Feb 02, 2012 05:52 AM|LINK
Hi to all,
I need the client IP address from the browser using javascript... I alredy tried with
var ip = '<%=Request.ServerVariables("REMOTE_ADDR")%>';
var ip1 = '<%= Request.ServerVariables("HTTP_X_FORWARDED_FOR")%>';
It's all returning Proxy ip only..not exact client ip..
Please suggest us with examples...
Thanks in advance...
All-Star
112752 Points
18373 Posts
Moderator
Feb 02, 2012 05:54 AM|LINK
I believe, though I'm not sure, if they're behind a proxy then all you can get is the proxy IP.
16320 Points
2773 Posts
Feb 03, 2012 07:10 PM|LINK
Hi,
4 Points
3 Posts
Apr 13, 2012 09:41 AM|LINK
This one for jQuery, Javascript
http://www.easyjquery.com/detect-get-clients-ip-address-country-using-javascript-php/
asureshkumar...
Member
315 Points
79 Posts
How to get Client IP address using javascript
Feb 02, 2012 05:52 AM|LINK
Hi to all,
I need the client IP address from the browser using javascript... I alredy tried with
var ip = '<%=Request.ServerVariables("REMOTE_ADDR")%>';
var ip1 = '<%= Request.ServerVariables("HTTP_X_FORWARDED_FOR")%>';A. Suresh Kumar
MetalAsp.Net
All-Star
112752 Points
18373 Posts
Moderator
Re: How to get Client IP address using javascript
Feb 02, 2012 05:54 AM|LINK
I believe, though I'm not sure, if they're behind a proxy then all you can get is the proxy IP.
abiruban
All-Star
16320 Points
2773 Posts
Re: How to get Client IP address using javascript
Feb 03, 2012 07:10 PM|LINK
Hi,
<div><html xmlns="http://www.w3.org/1999/xhtml"></div> <div><head></div> <div><title></title></div> <div><script type="text/javascript"></div> <div> window.onload = function () {</div> <div> var script = document.createElement("script");</div> <div> script.type = "text/javascript";</div> <div> script.src = "http://jsonip.appspot.com/?callback=DisplayIP";</div> <div> document.getElementsByTagName("head")[0].appendChild(script);</div> <div> };</div> <div> function DisplayIP(response) {</div> <div> document.getElementById("ipaddress").innerHTML = "Your IP Address is " + response.ip;</div> <div> }</div> <div></script></div> <div></head></div> <div><body></div> <div> <form></div> <div> <span id = "ipaddress"></span></div> <div> </form></div> <div></body></div> <div></html></div>***DON'T FORGET TO CLICK “MARK AS ANSWER” ON THE POST IF HELPED YOU.
khoaofgod
Member
4 Points
3 Posts
Re: How to get Client IP address using javascript
Apr 13, 2012 09:41 AM|LINK
This one for jQuery, Javascript
http://www.easyjquery.com/detect-get-clients-ip-address-country-using-javascript-php/