How can I obtain the IP address of the request server. php, and then use B. input parameters to. php, how to make. php knows the IP address of B. thank you for obtaining the IP address of the requesting server.
I have A. php on server a, and then use B. php on server B to pass the parameter to a. php. how can I let a. php know the IP address of B? thank you for sharing:
------ Solution --------------------
$ _ SERVER ['remote _ ADDR '] obtains the IP address of the requester.
------ Solution --------------------
Gethostbyname: get the IP address of the specified Internet host name.
Example:
Echo gethostbyname ('bbs .csdn.net '); // 117.79.157.198
------ Solution --------------------
Reference:
I have A. php on server a, and then use B. php on server B to pass the parameter to a. php. how can I let a. php know the IP address of B? thank you.
$ _ SERVER [SERVER_ADDR]
------ Solution --------------------
Generally, the REMOTE_ADDR, HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP, and HTTP_X_FORWARDED_FOR parameters of the $ _ SERVER variable are used.