473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to detect ip address of remote computer

34
I am trying to determine the ip address of a remote computer accessing my webpage. I do this to determine if the user if logged on elsewhere. If so, the server will reject actions from the previous location and log the user in from the new location. However, since all the computers are behind the gateway, I use $_SERVER['REMOTE_ADDR']; and only get the static ip of the gateway. Is there anyway to find out which specific computer is trying to login?

If not, is there any other way of trying to keep the user session valid from one computer at one time only??

thanks.
Apr 3 '08 #1
3 4503
TheServant
1,168 Expert 1GB
Hmmm, the only IP stuff I have used was the $_SERVER['REMOTE_ADDR'], so I should look into this not only for you but also for me... But a possible temporary solution:

A session should be stored in the browser, so if the user uses another computer it should not have anything from the old session.

Using this, you can remove any previous sessions by recording session name every time they log in, and then every login running a code to destroy the last session - session_destroy() - they were using and replace the session name variable with the new one.
Apr 3 '08 #2
$_SERVER['REMOTE_ADDR'] - it's the simplest way that are not affective now...
The biggest part of users going to internet throw proxy...
But you can do something:
1) handle proxy headers (if any proxy header exist => proxy)
2) detect host name that user come from and compare it's IP with user's IP, if IP's are different => 100% proxy
3) if not 1) and not 2) => it can be real user's IP
Here you can find all proxy headers and host 'CONNECTED FROM'
IP information
Oct 28 '08 #3
benicio
16
Great info. I now knew.
Nov 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Yang Li Ke | last post by:
Hi guys, What's a good way to detect if an ip is a proxy ? Thanx ! :) -- Yang
10
by: Ben Xia | last post by:
Is there some way can detect MAC address with PHP? any help will be appreciate. Ben
13
by: Jay | last post by:
I need to write a program to find mac address of a remote computer, is this possible? How?
0
by: Just D. | last post by:
Does anybody knows the solution if this problem? If we wrote the ASPX page and send the request to the remote browser the remote client browser returns the remote machine IP using by this machine...
4
by: Chris Johnson | last post by:
Hey all, I have a small app I have developed that periodically pings a list of server and returns their status. Given my environment I have setup the program such that a server can be down 4...
2
by: schaf | last post by:
Hi Ng ! I'm a little confused because of my application. I need to access a file in the path C:\Temp\test.txt on a computer in the same network. Now I just know the IP address of this PC. Is it...
6
by: felix.citycs | last post by:
Why I cannot do with this code and exception is thrown with "the requested address is not valid in its context" try { IPAddress inputDNS_IP = Dns.Resolve(inputDNS_IP).AddressList; // start...
0
by: hisham123 | last post by:
hi I Create small Vb 6.0 Application which shows the computer name in message box. I Store the application in my system. If i run the application from my system it shows the computer name of...
11
by: mp- | last post by:
I want to be able to allow people to check their email from my PHP online application. Given only the users 1) email address, 2) username (if applicable) and 3) password - how can I auto detect...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.