In web programming, with the server variable
, you can get the IP address of the user. For example in PHP:
The output on the page is the IP address of the user.
But how the server knows the IP address of the user?
Thanks in advance.
Certain information about the user is always passed to the webserver when a connection is established. IP Address is one of them.
unless you are in a LAN, its usually the ip-address of the router that gets displayed when visiting public web sites.
hope that helps.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)