redarrow Posted May 9, 2006 Share Posted May 9, 2006 this code shows 4 dates in a select box, I need to know how to get the select box to start fom a 00-00-00 then show the first date month year .so if a user has only two dates to select the daefult last two dates are 00-00-00 but under the 00-00-00 you get the same affect as it is know.[code]<form method="POST" action="test.php"><?for ($i=1;$i<5;$i++){?>Day<?=$i?>:<select name="day<?=$i?>"><?for($days=01;$days<32;$days++){?><option value="<?=$days?>">Day <?=$days?></option>';<?}?></select><select name="month<?=$i?>"><?for ($months=1;$months<13;$months++){?><option value="<?=$months?>" <? if($months == $month){ echo "selected";} ?>>Month <?=$months?></option>';<?}?></select><select name="year<?=$i?>"><?for($years=2006; $years<2010;$years++){?><option value="<?=$years?>" <? if($years == $year){ echo "selected";}?>>Year <?=$years?></option><?}?></select><br /><?}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9394-select-box-date-cheers/ Share on other sites More sharing options...
ober Posted May 9, 2006 Share Posted May 9, 2006 You might want to start by telling us what it does now and what you want it to do. Provide sample outputs. Your question is confusing. Quote Link to comment https://forums.phpfreaks.com/topic/9394-select-box-date-cheers/#findComment-34601 Share on other sites More sharing options...
redarrow Posted May 9, 2006 Author Share Posted May 9, 2006 in the database i got these varables[code]$dates1$dates2$dates3$dates4date format is day month year ("d-m-y")[/code]if the user updates there code i get the defult values of dates.i need to get the users varables from the database and get them in the select box so that they no what they got know and what to chage to.<? echo $row["dates1"]?> ect.......<<<<<<<<< need somthink like this added cheers. [code]<form method="POST" action="test.php"><?for ($i=1;$i<5;$i++){?>Day<?=$i?>:<select name="day<?=$i?>"><?for($days=01;$days<32;$days++){?><option value="<?=$days?>">Day <?=$days?></option>';<?}?></select><select name="month<?=$i?>"><?for ($months=1;$months<13;$months++){?><option value="<?=$months?>" <? if($months == $month){ echo "selected";} ?>>Month <?=$months?></option>';<?}?></select><select name="year<?=$i?>"><?for($years=2006; $years<2010;$years++){?><option value="<?=$years?>" <? if($years == $year){ echo "selected";}?>>Year <?=$years?></option><?}?></select><br /><?}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9394-select-box-date-cheers/#findComment-34637 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.