PDA

View Full Version : Quick question with php


Iskib
06 Mar 2008, 20:44
Sinario:

I have a banned user table in my database

When a user signs up I want to check the username against this list.

in database banned usernames
test
admin
mod

I can do this with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



What is I wanted to check if any part of the username exsist in the database.

for example if the user tried to register
test1, test_now, testtaco
admin_me, admin1, adminme
mod1,mod_me,modme

What code would I use to pickup these partials ?

MoT3rror
06 Mar 2008, 20:48
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Iskib
06 Mar 2008, 20:55
Hey,

Thanks for the quick response. This is for another app not vbulletin.

I know I can check the database for the username entered , but what if they use part of a username that exsist for example admin is banned

what if they try to register admin1 or adminMe

MoT3rror
06 Mar 2008, 22:13
Use mysql wildcards like this.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Iskib
06 Mar 2008, 23:40
Hey,

No that didn't work. It returned for example:

admin as a banned username , but when I tried admin1

it still let admin1 be registered as a user

MoT3rror
07 Mar 2008, 00:25
Sorry it should use a like then a equal sign.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Iskib
07 Mar 2008, 07:16
Hey still not working

Here is what I have full code..



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



--------------- Added 1204900783 at 1204900783 ---------------

Other then the mySQL wildcard is there anyway of matching any username that would have part of a banned username? maybe a reg expression ?

Opserty
07 Mar 2008, 14:42
Does AdminCP > vBulletin Options > vBulletin Options > User Registration Options > Illegal User Names not cover what you want to do?

Iskib
07 Mar 2008, 17:47
No. As I said in the third post in this thread. It is not a vbulletin site therefore the vbulletin option can not be used.

I am just asking for a little help

Opserty
07 Mar 2008, 18:12
No. As I said in the third post in this thread. It is not a vbulletin site therefore the vbulletin option can not be used.
Ah right must have missed that post.