Last active
September 28, 2016 14:00
-
-
Save mehdichaouch/ba7d5aa546ad8f5f7badf7b7ac845593 to your computer and use it in GitHub Desktop.
PHP Snippet to test code only with white-list IP, without disturbing other people
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @author : https://gist.github.com/mehdichaouch | |
/** BEGIN DEV ****************************/ | |
try { | |
$clientIp = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; | |
$teamIp = array( | |
'10.71.3.17', //mehcha | |
'YOUR IP', | |
); | |
if (in_array($clientIp, $teamIp)) { | |
var_dump( | |
); | |
//Zend_Debug::dump(); | |
} | |
} catch (Exception $e) { | |
} | |
/** END DEV ****************************/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment