Click to See Complete Forum and Search --> : banning from a site using cookies/php


bdg1983
10-28-2001, 12:12 AM
Hi, I've got some disruptive users on my forum (homemade(Click Here (http://gaffle.net/forum2/))) that I would like to get rid of.

Background info:
When the user logs in, it sets a cookie for 30 days. The purpose is to completely ban this user from viewing the site.

Now, what I thought about doing, to rid the forum of this one person who's username is "tom"...

is by, next time, when someone submits a new topic, or a new response to a topic, it will check to see if his username is "tom", if it is, it will set another section in his cookie labled "not_coming_back 1".

Then, in an include file that goes into every single page, i would put something along the lines of:

<?php
if($not_coming_back = '1'){
header("Location:http://cnn.com");
}
?>

That works sometimes..but if you go straight to the forum, it states that it can't send the header because they've already been sent.

So basically, I need another way to keep this user from visiting the site.

any help is appreciated.

Alex

saithan
10-28-2001, 01:39 AM
This might not be what you are looking for but you can look in your access log to ID the users IP if it is static you can set apaches directive to deny that user access.
or you can use "*" to ban an entire IP range.
also I have seen a good perl script called sniper that is awsome at baning users.
last i looked it was at
http://www.millennium-crew.com
that might help.

iDxMan
10-30-2001, 12:03 AM
IP list "temp ban" users would probably be better. Otherwise you're relying on his PC to hold the ban information. A simple clean of the cookies and he's back..


Offtopic: I noticed you have a cs forum.. You or dawg ever play Tampabay RR -- when it was up ?

snail4u
11-08-2001, 01:08 AM
if you still want to manage this problem by setting cookies you schould create a php file with only the script that checks whatever you need to check and than make sure that all of your files have a <?php include("filename.php") ?> at the beginning.

i hope i could help