Dropdown box to display variable values

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I would like to be able to display the actual values of a variables (or
in other words, populate) the options for the drop down box.

For example:  I would like to define a variable yesterday and today.
Then, I would like to display the yesterday's date and today's date on
the dropdown box.  Of course, by tomorrow, the options should change.
Is this possible?

To clarify further, today would be 1-9-2007  and yesterday would be
1-8-2007.  So, I would like a dropdown box that displays those dates
today.  However, by tomorrow, the dropdown box should display 1-9-2007
for yesterday and then 1-10-2007 for today.

I would really appreciate any kind of help.

Re: Dropdown box to display variable values

fun2trash@gmail.com wrote:
Quoted text here. Click to load it

Need scripting. Here is a PHP solution

<select name="appointment">
    $numberOfDay=10; //set as required
    for($i=0; $i<$numberOfDay; $i++){
        $theDate=date('m-d-Y', strtotime("+$i Days"));
        echo "<option value=\"$theDate\">$theDate</option>";

Take care,


Site Timeline