How can I ban a username on my site using php & MySQL?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Justsomeguy

    How can I ban a username on my site using php & MySQL?

    I want to able to ban usernames on my site. I've got an interface for site admins to use and i've set up a database already. I don't want to ban IP addresses because there are ways around that. I know that people can just sign up again to avoid the ban, but I want to start with the basics for now, I can always make changes later. Does anyone know a script that can check the username from the session and cross reference it with the usernames from the database and if there's a match, the user will be redirected to another page?

    Thanks in advance,
    Justsomeguy :)
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Do you have a status field or similar field for users? You could set that to "banned" or if that is not an option create another field to be used as a flag for banned users. Then check to see if the user is not flagged before allowing them access.
    Last edited by JKing; Oct 8 '10, 07:31 PM. Reason: Grammar

    Comment

    Working...