Does anyone know of any javascript that will get the users ip address?
I can do it in php, but want it done in javascript
Thanks!
| SitePoint Sponsor |
Does anyone know of any javascript that will get the users ip address?
I can do it in php, but want it done in javascript
Thanks!


You can not get a users IP address in JavaScript.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
Thats what i thought, thanks for the reply

You can combine JavaScript with some other language to get the IP address.
See http://javascript.about.com/library/blip.htm for seven different pieces of JavaScript that can be used to load the visitor's IP address into a JavaScript variable depending on whether you want to use Java, SSI, PHP, ASP, .NET, JSP, or ColdFusion to pass the address into the JavaScript.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
Bookmarks