How does php obtain the port used by the user to log on to the website? server port: User Port
Title:
How does php obtain the port used by the user to log on to the website?
Or
How does php obtain the port used by the user to connect to the server?
Content *************************************** ************
I found in Baidu that the $ _ SERVER ['remote _ port'] function can be used to obtain the PORT. I tried it in the local php environment and can obtain my PORT after we log on or exit, but when I move my stuff to my server, I cannot get it. let's help solve it! Thank you !!!
Reply to discussion (solution)
The server is a windows iis service.
Is there a port in the address to obtain the Port? generally, port 80 is used on the server, which is the default port.
Are you talking about the client port or the server port?
Required by network monitor
The website is required to record the user's logon and exit ip addresses and ports !!!
It must not be port 80. it is the port for the user to access the server. this number keeps changing.
In earlier versions of IIS, php does not have $ _ SERVER ['remote _ port'] (in Windows 2008 + IIS7.5)
You need to download the REMOTE_PORT patch on the Microsoft website.