global $P; // page.php?P=2007-canada.html
/*
66.130.62.124 [ 271 Messages ]
24.202.127.192 [ 208 Messages ]
69.70.236.217 [ 80 Messages ]
74.56.0.240 [ 75 Messages ]
74.56.14.92 [ 21 Messages ]
74.56.0.38 [ 13 Messages ]
74.56.26.224 [ 11 Messages ]
74.56.20.195 [ 10 Messages ]
66.131.59.203 [ 21 Messages ]
24.200.221.61 [ 20 Messages ]
69.70.83.121 [ 19 Messages ]
*/
$BlackList = array("66.130.62.124", "24.202.127.192", "69.70.236.217", "69.70.83.121", "24.200.221.61", "74.56.*.*");
$ip = $_SERVER['REMOTE_ADDR'];
$tabIp = split('[.]', $ip);
$bOk = true;
foreach($BlackList as $B) {
if (strpos($B, "*") === false) {
if ($B == $ip) {
$bOk = false;
break;
}
} else {
$t = split('[.]', $B);
$bEgal = true;
for ($i = 0; $i < 4; $i++) {
if (($t[$i] != '*') && ($t[$i] != $tabIp[$i])) {
$bEgal = false;
break;
}
}
if ($bEgal) {
$bOk = false;
break;
}
}
}
// $Dir = "C:/Program Files/Apache Group/Apache2/htdocsVISIOFleet/perso/hb/";
$Dir = "C:/xampp/htdocsVISIOFleet/perso/hb/";
if (!isset($P))
$P = "===";
if (! $bOk) {
$P = "---";
} else {
}
$P = 'g_' . $P;
if (file_exists($P)) {
// ouvre un fichier en mode binaire
$F = $Dir . $P;
$fp = fopen($F, 'rb');
// envoie les bons en-têtes
//header("Content-Type: $ContentType");
//header("Content-Length: " . filesize($F));
// envoie le contenu du fichier, puis stoppe le script
fpassthru($fp);
exit;
} else {
echo("erreur ouverture fichier / fichier inexistant");
}
?>