How to validate the host name in PHP?
That is if suppose am running my application server on IP:192.168.1.77 and if the request contains the Host name other than 192.168.1.77 it should not allow the further processing.
Any help or suggestion would be appreciated.
What for? This is something the web server will already deal with if it’s set up properly:
There’s no need to additionally check for this in the PHP script.
It is entirely pointless and will not add any security whatsoever. However, I guess there’s no harm in doing it, either.