need some help here

admin

Administrator
Staff member
hello as i have stated in atleast one past post i'm working on a web site..well this site has a username/password on it and i was wondering if there is a way to keep track of the ip's that access the site sorting them by the username...if that makes since....basically have each user name listed and the ip's that have been used for each user name...so maybe a username then under it the ip...or ip's listed with the username that went to that ip....if there is anyway of doing this i would really appreciate the help thanks<!--content-->Gathering an IP can be done using a serverside language, but there are some difficulties to overcome. Most people logging on will have a different IP each time.<br />
<br />
If they use a dial-up connection (phone) then the ISP assigns a dynamic IP to them, one that changes each time they access the internet.<br />
<br />
Those with a DSL (high speed phone) may have 3 or less IP assigned to them each time they access the internet.<br />
<br />
Those with direct cable may have one static IP.<!--content-->so should i repost my question in the area for the server side??...or would you know of a site that i can find out what i need...and i understand that the ip's will change for dial up and dsl..but they will be close to the same...usually only the last 2 sets on the ip change....thanks for the help<!--content-->You can either repost in the ServerSide forum area, or when one of the moderators stop by, they may move this current thread in there.<br />
<br />
In either event, be sure to post what server side features you have available. Perl, PHP, other...<br />
<br />
With Perl you can do something simple like this...<br />
$VisitorIP = "$ENV{'REMOTE_ADDR'}";<br />
Then store or manipulate the value as you require.<br />
<br />
**edit**<br />
<br />
It seems this may provide a bit more accurate result...<br />
<br />
$VisitorIP = $ENV{'HTTP_X_FORWARDED_FOR'} || $ENV{'REMOTE_ADDR'};<br />
<br />
**/edit**<!--content-->Sure ips aren't always static, but you could check to see if IPs say from Missouri and Oregon, and California, and then find out that somene is sharing their information.<!--content-->yes cfhosting and that's exactly the purpose of me wanting to do this with the site..there are certian people that we dont want in the site and that is one way to do so...the 1 main person that we dont want in always has the same ip so wouldn't be to hard to find out if that person has gotten access and who gave them the access this way<!--content-->
 
Back
Top