Skip to content

Instantly share code, notes, and snippets.

@markreale
Created August 7, 2012 21:12
Show Gist options
  • Save markreale/3289410 to your computer and use it in GitHub Desktop.
Save markreale/3289410 to your computer and use it in GitHub Desktop.
Restrict PHP code to a specific IP Address
<?php
$thisIp = $_SERVER['REMOTE_ADDR'];
if($thisIp == 'the.ip.you.test'){
// Do something
}
else{
// Show the normal state
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment