PDA

View Full Version : Birth year range during registration


ccplim
05-02-2005, 05:30 AM
Is there a way where we can restrict new member to enter the birth year range from something like 1900 to 2005 during registration?

I have some joker members who enter their birth year by entering 0000 or some funny number :disappointed:

why-not
05-03-2005, 11:21 AM
Is there a way where we can restrict new member to enter the birth year range from something like 1900 to 2005 during registration?

I have some joker members who enter their birth year by entering 0000 or some funny number :disappointed:

If you open 'register.php' in your install directory './' you can change the regex to what you want to use! I would just use 19?? as there should not be anyone 5 years old trying to register on any forum!

Here is how to do this....

Open register.php

FIND THIS....

if ($month == 0 OR !preg_match('#^\d{4}$#', $year))
{
eval(print_standard_error('select_valid_month_and_ year'));
}


REPLACE WITH...

if ( $month == 0 OR ! preg_match ( "!^(19[0-9]{2}|200[0-5]{1})$!", $year ) )
{
eval ( print_standard_error ( 'select_valid_month_and_year' ) );
}


Sonia

T3MEDIA
05-03-2005, 12:19 PM
Try this as well to make sure they dont put the age under and this also keeps the age unchangeable. (admins can change)

[vB 3.0.3] Force 18 and over at Registration Time. (https://vborg.vbsupport.ru/showthread.php?s=&threadid=74808)

If you open 'register.php' in your install directory './' you can change the regex to what you want to use! I would just use 19?? as there should not be anyone 5 years old trying to register on any forum!

Here is how to do this....SoniaMay I add this to my hack? so it restricts super old users?

why-not
05-03-2005, 01:17 PM
Try this as well to make sure they dont put the age under and this also keeps the age unchangeable. (admins can change)

[vB 3.0.3] Force 18 and over at Registration Time. (https://vborg.vbsupport.ru/showthread.php?s=&threadid=74808)

May I add this to my hack? so it restricts super old users?
You know what I should have directed him or her to your mod, I just installed this for someone a few weeks ago and forgot about it. It does work great, thanks for tip again!!!

Sure you can add it if you like!!!

Take Care

Sonia

ccplim
05-05-2005, 02:11 PM
Thanks to both T3MEDIA and Sonia. I shall give this a shot and see how it goes :)