Hai all,
I would make a ip block script for my site. The blocked ip are stored in a
file.
I have made the following script. Why does this not work. The file entries
must be stored in a array and after that i must check all the fields in the
array. Please help...
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$bestand = "ipblock.tx t";
$open = fopen($bestand, "r");
$iparray = file ($open);
$n = 0;
while ($n < count($iparray) ) {
if ($iparray[$n] == $ip) {
print ("NOT");
else {
print ("YES");
$n++;
}
}
?>
FiremanSAM
I would make a ip block script for my site. The blocked ip are stored in a
file.
I have made the following script. Why does this not work. The file entries
must be stored in a array and after that i must check all the fields in the
array. Please help...
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$bestand = "ipblock.tx t";
$open = fopen($bestand, "r");
$iparray = file ($open);
$n = 0;
while ($n < count($iparray) ) {
if ($iparray[$n] == $ip) {
print ("NOT");
else {
print ("YES");
$n++;
}
}
?>
FiremanSAM
Comment