1,105,295 Community Members

Get Client Ip Address

Member Avatar
satyavinayak
Newbie Poster
1 post since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i am developing a online chat application, for that i have a server with static ip.
i want to give only small javascript to include in client website.
here my requirement is obtain ip address and the location of the user of the website.
websites my in in any language like php,jsp,html,asp....for any wesite my script is same
please help me in this issue to solve..

i am giving script like
<script src="http://ipaddress/jascripts/chat.js"></script>

this script needs to retrive the ip address of the visitor of website..

Member Avatar
pritaeas
mod_pritaeas
11,291 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,832 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 

You can try $_SERVER['REMOTE_ADDR'] but it may not be accurate.

Member Avatar
bops
Posting Whiz
301 posts since Aug 2005
Reputation Points: 1 [?]
Q&As Helped to Solve: 17 [?]
Skill Endorsements: 0 [?]
 
0
 

Little confused as to what you're trying to achieve. Do you want to get the user's IP address using Javascript or PHP/Other serverside language? Pritaeas' solution should work on the PHP end.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article