<?
// 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.";
}
?>