Help me with my IP bann script
Posted: Thu Mar 16, 2006 7:12 pm
I got the structure from the tutorial and heres how my script looks so far
anyway I get an error on line 8 and 11, cant figure out why.
And I didnt find any info about "$REMOTE_ADDR" but I think its a built in variable for IPs connected to the server right? So yea if you could help me get rid of these errors it would help alot...Thanks.
Code: Select all
<?php
$bann = fopen ("C:\www\learning%php\banned.txt", "r"); // this is line 8
$read = fread ($bann, 9000);
fclose($bann)
$badr = explode {$read}; // this is line 11
if (in_array($REMOTE_ADDR, $badr){
echo "Sorry you have been banned";
die;
}
?>And I didnt find any info about "$REMOTE_ADDR" but I think its a built in variable for IPs connected to the server right? So yea if you could help me get rid of these errors it would help alot...Thanks.