Jump to content


Photo

select box date cheers


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 09 May 2006 - 01:52 PM

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.

<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 />
<?
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 09 May 2006 - 01:58 PM

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.

Info: PHP Manual


#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 09 May 2006 - 03:24 PM

in the database i got these varables

$dates1
$dates2
$dates3
$dates4

date format is day month year ("d-m-y")


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.


<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 />
<?
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users