N-Bomb(Nerd) Posted May 28, 2009 Share Posted May 28, 2009 What's the best method to take when I'm wanting to create a banlist for one of my websites? I was considering adding a query on my includes page that's included on every page, but there has to be a different method than running a sql query on each page just to see if they're banned. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/ Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 maybe a text file.. or maybe write to the .htaccess file order allow,deny deny from 123.456.789.123 deny from 23.456.78.91 allow from all Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843765 Share on other sites More sharing options...
PFMaBiSmAd Posted May 28, 2009 Share Posted May 28, 2009 A ban list for what? You have not exactly stated what it is you are trying to ban. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843775 Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 ooow good point, I assumed for the site as he said on each page.. meaning all pages..maybe! Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843777 Share on other sites More sharing options...
N-Bomb(Nerd) Posted May 28, 2009 Author Share Posted May 28, 2009 After thinking about this some more, I'm thinking of going with a suspension system. Where they get suspended for a day or two, and when they come back if they get suspended again then they're suspended a bit longer this time. It just keeps going up a few times then it just permanently bans them from my website.. so I'm guessing that I have to do that sql query on every page load right? Is that going to be the least bit stressful on the server? Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843783 Share on other sites More sharing options...
BobcatM Posted May 28, 2009 Share Posted May 28, 2009 Are you going to have Members, as in usernames they log in, or just ip's, or?? Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843784 Share on other sites More sharing options...
N-Bomb(Nerd) Posted May 28, 2009 Author Share Posted May 28, 2009 Are you going to have Members, as in usernames they log in, or just ip's, or?? Oh yes, my website has user logins.. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843799 Share on other sites More sharing options...
acctman Posted May 28, 2009 Share Posted May 28, 2009 if the user are login in you can have field in the member table ban_del... then when the user logs in check to see if the ban_del field has a 1 (yes) if so then redirect the user to a ban page and you can re-log there IP so if they attempt to create another account you can flag it. Another security measure you could use is to set a cookie so if there IP changes the cookie would know that they're banned. I use all 3 of those methods which stop 99% of banned users for my site from attempting to create another account. An experienced user can easily get around those methods but I just have a community site and I doubt anyone would waste there time trying to get back on my site. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843801 Share on other sites More sharing options...
PFMaBiSmAd Posted May 28, 2009 Share Posted May 28, 2009 I have to do that sql query on every page load right Yes, if you want your system to enforce a change in the user's status (suspended/banned...) on any page request. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843803 Share on other sites More sharing options...
N-Bomb(Nerd) Posted May 28, 2009 Author Share Posted May 28, 2009 I have to do that sql query on every page load right Yes, if you want your system to enforce a change in the user's status (suspended/banned...) on any page request. Would that cause much stress on the server doing that though even if there's a few hundred people on at once. Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843865 Share on other sites More sharing options...
acctman Posted May 28, 2009 Share Posted May 28, 2009 I have to do that sql query on every page load right Yes, if you want your system to enforce a change in the user's status (suspended/banned...) on any page request. Would that cause much stress on the server doing that though even if there's a few hundred people on at once. actually surprisingly it doesn't... sql queries are exteremly fast depending on how they're written and if you're not doing a wildcard of everything. i've done queries of over 10,000+ records and it only takes .5secs or less.. so no worries Quote Link to comment https://forums.phpfreaks.com/topic/159965-creating-a-banlist/#findComment-843879 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.