assuming php is running in web mode via cgi / mod_php / etc ...
it is safe to assume that $ _SERVER ['REMOTE_ADDR'] exists, and, in addition, it will contain correctly styled (sorry, the terminology may be here ...) ip (1.1.1.1 → 255.255.255.255?)?
this is not a question regarding the weather contained inside $ _SERVER ['REMOTE_ADDR'] will be the true ip of the client making the request, since I understand that this can be "faked" by changing the outgoing tcp packets ...
simply:
a) $ _SERVER ['REMOTE_ADDR'] will exist if php starts in web mode. b) if $ _SERVER ['REMOTE_ADDR'] always exists, will it always contain the correct syntax ip?
thank.
source
share