On my website, I have completed the ban system, but I always thought I missed something. And I was, timed bans. So could anyone display an example of how the script should look? I'm looking for banned by hours and/or banned by days.
Easy.
<?
function BanUser($user){
$banned_until = time() + 36000; //1 day I believe
mysql_query("UPDATE users SET status='banned' AND banned_until=$banned_until WHERE username='$user'");
}
function CheckUser($user){
$time = time();
if(mysql_num_rows(mysql_queey("SELECT * FROM users WHERE username='$user' AND status='banned' AND banned_until>$time))>=1){
die("You are banned!")
exit();
}
}
?>