xyn Posted September 17, 2006 Share Posted September 17, 2006 HiiI've got a mini problem, but I kinda need advice.I have an idea of blocking naughty members frommy website, and to do this I thought I'd make a timedban.I wanted the whole thing to be optional like, from 1 minuteto 7 years... obviously in the way like x minutes, xhours,x days, etc...I thought Making a database and adding the "Number" andthe "Lengeth" into the database and using:strtotime("today -$TimeVar $Lengthvar");to extract that information :/ But it's confused mebecause I don't think it will work with minutes or that. Link to comment https://forums.phpfreaks.com/topic/21073-time-blocking/ Share on other sites More sharing options...
Wintergreen Posted September 17, 2006 Share Posted September 17, 2006 Just thinking, not fully sure how you'd implement it, but you could create another column in your users table along the lines of is_banned, making it DATETIME format (0000-00-00), the default being empty. Then if you want to ban someone you can make yourself a form allowing you to ban for however many days or whatever you'd like, and then use date functions to get the current date and add your ban time to it. Then make a check when users log in to see if they're banned by comparing the current date to the is_banned row, and if their ban time isn't up just exit out of the login or print a message saying what's up. Link to comment https://forums.phpfreaks.com/topic/21073-time-blocking/#findComment-93571 Share on other sites More sharing options...
xyn Posted September 17, 2006 Author Share Posted September 17, 2006 i was thiking something of that, i'll have a little go. Link to comment https://forums.phpfreaks.com/topic/21073-time-blocking/#findComment-93678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.