Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Data validation on Birthdate and username?
Lately I've had some issues on my site with people either having malformed (as in, way too many slashes), improbable/impossible birth years (such as 1900 or 1003), and usernames with special characters (which probably won't validate against PMs and such properly). Is there any way to make sure the information they give is at least in the right format and/or the birth year is plausible before they sign up?
|
#2
|
||||
|
||||
I'm not too sure on the date checking, but you should be able to prevent special characters in usernames by adding this under "protected function usernamevalidate" in class_registervalidator.php:
PHP Code:
PHP Code:
http://stackoverflow.com/questions/3...characters-php EDIT: Thought I should say that this won't/can't do anything about users who already registered with special characters; only new ones.
__________________
Last edited by Dinocanid; 05-06-2017 at 09:37 PM. |
#3
|
||||
|
||||
The birthday is actually pretty simple.
You just need to drop PHP Code:
EDIT: It looks like I was wrong. You need to partially re-write the birthdayvalidate function like so: PHP Code:
Last edited by KatFennec; 06-05-2017 at 03:07 AM. Reason: Mistake in code |
|
|
What's New? |
What's Hot? |
What's Popular? |