Skip to content

Instantly share code, notes, and snippets.

@anytizer
Created March 27, 2014 09:32
Show Gist options
  • Save anytizer/9803735 to your computer and use it in GitHub Desktop.
Save anytizer/9803735 to your computer and use it in GitHub Desktop.
Server variables safety
if(emtpy($_SERVER['REMOTE_ADDR']))
{
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
if(emtpy($_SERVER['SERVER_NAME']))
{
$_SERVER['SERVER_NAME'] = 'localhost';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment