All pastes #235193 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-11-03 02:07 UTC
rendered paste body
<?
// allowed ip list
$iparray = array (
                "127.0.0.1",
                "host.com",
                "tehserver",
                "eh"
                );

// check for each item in $iparray
for ($x=0;$x<count($iparray);$x++) {
        // compare HTTP_HOST to the current item in $iparray
        if ($_SERVER['HTTP_HOST'] == $iparray[$x]) {
                // if it matches, set $access to 1
                $access = 1;
                // break out of the loop
                break;
        }
}

// check if $access was set
if ($access) {
        // do this if it was
        echo "Generating..";
} else {
        // do this if it was not
        echo "No access.";
}
?>