Code: Select all
<?
$banned[0]="82.100.220.59";
$banned[1]="119.27.62.254";
if (in_array($_SERVER['REMOTE_ADDR'],$banned))
{
echo "<b>You have no permission to visit this site.</b>";
exit;
}
?>
<html>
<h1>voorbeeld.com </h1>
<br>
This site is under construction <br>
Regards moderator. <br><br>
<A HREF="http://www.voorbeeld.com/contact.php">Contact</A> <br><br>
</html>
<?
$ip= $_SERVER['REMOTE_ADDR'] . " - index.php - " ;
$date= date('D M j G:i:s T Y') . " -";
$data= $date . " ". $ip;
$logfile = '/home/polarbear/domains/voorbeeld.com/public_html/log.php';
if (!$handle = fopen($logfile, 'a+')) {
die("Failed to open log file");
}
if (fwrite($handle, $data ) === FALSE) {
die("Failed to write to log file");
}
fclose($handle);
?>