Hello. I've made an IP banner. What I'm doing is just running:
checkban(); in each page. However, if they are banned it's just showing it at the top of the page like this:
http://img.photobucket.com/albums/v198/m37h0dm4n/ipban.jpg
For my layout I am including my header and footer if that helps.
This is my IPbanner code that I made.
<?
function checkban()
{
$curip = $_SERVER['REMOTE_ADDR'];
mysql_connect("localhost","brayden_cf","puma");
mysql_select_db("brayden_cf");
$select_ip = ("SELECT * FROM ipaccess WHERE ip='$curip'");
$vers = mysql_query($select_ip);
$row = mysql_fetch_array($vers);
if ($row){
echo "The IP ".$row['ip']." is banned from this website. Please contact [email]support@clan-finder.com[/email] if you think this is an error!";
exit;
}
exit;
}
?>
I thought the exit's would make it just a blank page with the echo, but it doesnt. I have checkban(); at the top of the page.
Any help is appreciated!
Thanks,
Method.