PHP

This guide will show you how to whitelist your GoodAccess IP address in PHP.

There are multiple ways how to whitelist your GoodAccess IP in PHP. Below is an example of a basic whitelisting function. For more advanced setup, please refer to the following documentation.

function isAllowed($ip){
    $whitelist = array(β€˜111.111.111.111’, β€˜112.112.112.112’);    // If the ip is matched, return true
    if(in_array($ip, $whitelist)) {
        return true;
    }    return false;
}

Using the whitelisting function for access control.

if (! isAllowed($_SERVER[β€˜REMOTE_ADDR’])) {
    exit;
}

Last updated