PHP

PHP

Allowing access to a PHP application through the GoodAccess, please refer to the following documentation.

How to whitelist GoodAccess IP in PHP?

1
Function
2
function isAllowed($ip){
3
$whitelist = array(‘111.111.111.111’, ‘112.112.112.112’); // If the ip is matched, return true
4
if(in_array($ip, $whitelist)) {
5
return true;
6
} return false;
7
}
Copied!

Using the whitelisting function for access control

1
if (! isAllowed($_SERVER[‘REMOTE_ADDR’])) {
2
exit;
3
}
Copied!
Last modified 9mo ago