Updating member's birthday: month value does not show up right

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 20, 2012   (RSS)

Re: [hiroko] Updating member's birthday: month value does not show up right

By gkornbluth - November 19, 2012

Hi hiroko,

There must be something else going on outside of the specific code you posted.

When I mocked up the code in a viewer (CMSB version 2.14), I got the following:

January
February
March
April
etc.

Could you attach the entire viewer so someone can take a look?

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Updating member's birthday: month value does not show up right

By gregThomas - November 19, 2012

Hi Hiroko,

In certain versions of PHP you can't leave any parts of a date string as 0 when using the strtotime function. Try changing the code to look something like this:

<select name="month">
<?php foreach(range(1,12) as $month): ?>
<option value="<?php echo $month;?> <?php selectedIf($month,@$_REQUEST['month']);?>"><?php echo date("F",strtotime("1985-$month-01 00:00:00"));?></option>
<?php endforeach ?>
</select>


You can use whatever year and day of the month you like, as long as the $month variable stays the same.

Let me know if this doesn't work for you.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Updating member's birthday: month value does not show up right

By gkornbluth - November 19, 2012

Hi Greg,

Thanks for another new bit of information.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [greg] Updating member's birthday: month value does not show up right

By hiroko - November 20, 2012

Greg,

Thank you, this worked perfect!

hiroko