To retrieve the ip address using php is necessary the specific environment variable.
The $_SERVER variable.
//this is the variable $_SERVER['REMOTE_ADDR']
Inside this special variable there is the ip address of the user that open the page.
For example if we want print this variable this is the correct syntax:
//this print my ip address echo $_SERVER['REMOTE_ADDR'];
Easy!!
No comments:
Post a Comment