Answer the question
In order to leave comments, you need to log in
How to calculate the user's port on the site?
I am writing my website. In the logs of user actions, you need to store a pair of IP + port. I know how to get the user's IP. And how to get its port?
Answer the question
In order to leave comments, you need to log in
For http port 80, for https 443. The user has no port, your server has a port.
And to get on which port it connects, use
$port = $_SERVER['REMOTE_PORT']; // типа юзер порт
$serverPort = $_SERVER['SERVER_PORT']; // 80/443
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question