Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Birth date problem


jorgrds

Recommended Posts

Posted

I needed to change the date format to dd/mm/yy so I followed this link instructions http://www.oscommerce.com/forums/index.php?showtopic=103656&hl= .

 

It's working fine if insert date like 21/05/1970 for instance, but if I put it like this --> 1970/05/21 I don't get any error message and the account is created, is it a bug, or anything else ?

 

I also noticed this code :

 

-----------@catalog/create_account.php----------

 

if (ACCOUNT_DOB == 'true') {

if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {

$error = true;

 

$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);

}

}

 

 

 

P.S. I also found this new function, what do you think about it? Is it ok? http://www.oscommerce.com/forums/index.php?act...ndpost&p=537046

 

Thank you all :D

Posted

Well I solved the problem, doing the following :

 

I changed :

 

-----------@catalog/create_account.php----------

 

if (ACCOUNT_DOB == 'true') {

if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {

$error = true;

 

$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);

}

}

 

 

 

to :

 

-----------@catalog/create_account.php----------

 

if (ACCOUNT_DOB == 'true') {

if (!checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {

$error = true;

 

$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);

}

}

 

 

 

The changes made are colored red (removed) and blue (added). I noticed that this code is the same as the file account_edit.php and so it works!

 

:D

  • 2 weeks later...
Posted

This only seems to be part of the solution, unless your problem is a little different to mine.

 

I have amended the date formats in languages/english.php and was having problems with the date validation n create and amend account. Making the change you show here resolves the validation problem but the date doesn't seem to be written back to the db, when you go back into the account the field is blank.

 

Did you get any further with this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...