3
What is "logical port"? And how to detect the logic port of the user using PHP? Would that be?
$porta = $_SERVER['REMOTE_PORT'];
3
What is "logical port"? And how to detect the logic port of the user using PHP? Would that be?
$porta = $_SERVER['REMOTE_PORT'];
6
Physical ports are the physical connections of devices, such as a RJ-45 connector from a router or modem.
Logic ports are gates of logical connections identified by a number, which serve to connect to a service, TCP or UDP on a device (server, computer, etc).
A good analogy would be, imagine that you have a commercial building. It has an address (XXX Street, nr 1). This would be for example the IP address of the server. Once you enter the building, you can go to several places, with several rooms. Each room or apartment would be a logical door (XXX Street, Nr1, Room 10).
When accessing a web service (HTTP) from a website, in general it responds by logical port 80, a service FTP, on logic gate 21, and so on.
Logic gates range from 0 to 65535, and are divided into three groups:
Here is a complete list of the "well known doors": https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
Now back to PHP. In your example you are using $_SERVER['REMOTE_PORT']
. This will return you to the port you are connected to on the server.
Browser other questions tagged php ip
You are not signed in. Login or sign up in order to post.
the logical port is not user, it is server! remember that php runs on the server side, so it will show the port that the server made available for the user to connect to it. I don’t know if it’s clear, in practice it’s the port where the server and the user are communicating
– Ricardo Pontual