Is it possible for a user to forge the result that is returned from $_SERVER['REMOTE_ADDR']
in PHP so they could in theory use SQL injection on a database?
This is a bit dumb, but I'm still new enough to PHP that I want to know if it can be done, whether or not I need to sanitize database input when the SELECT
statement chooses from IP addresses returned from $_SERVER['REMOTE_ADDR']
. So, if I wanted to use something like $query = "SELECT * FROM users WHERE IP='" . $_SERVER['REMOTE_ADDR'] . "'";
, would there be any danger to my doing this?
Again, probably a "nooby" question, but I feel it must be asked.
Thanks