How do I detect the IP address of the viewer when he/she is trying to access my page?

Rama V

You can't do this from JavaScript, but if your server supports JSP, you can use the 'request' object to get this information.
Sample code:
write this code in the beginning of your jsp
<% String ip = request.getRemoteAddr(); %>
You can assign this to a JavaScript variable like var str = "<%=ip%>"

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact