# HTML Select/Option issue when parsing $\_POST variables

**URL:** https://forum.kirupa.com/t/html-select-option-issue-when-parsing--post-variables/289089
**Category:** programming
**Created:** [May 26, 2009, 9:44am UTC](https://forum.kirupa.com/t/html-select-option-issue-when-parsing--post-variables/289089 "2009-05-26T09:44:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![crayzee](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@crayzee](https://forum.kirupa.com/u/crayzee)
#### Post date: [May 26, 2009, 9:44am UTC](https://forum.kirupa.com/t/html-select-option-issue-when-parsing--post-variables/289089/1 "2009-05-26T09:44:46Z")

</div>

I have a problem where I parse variables in a HTML select statement.

on my form file I have each select statement as below:

```php

<td>From : <select name="mon_from_hour">
                    <?php    
                        foreach ($hour as $val_hr){
                            echo "<option>";
                            echo $val_hr;
                            echo "</option>";
                        }
                    ?>
                 </select>
                 &nbsp;:&nbsp;
                 <select name="mon_from_minute">
                    <?php
                        foreach ($minute as $val_mn){
                            echo "<option>";
                            echo $val_mn;
                            echo "</option>";
                        }
                    ?>
                 </select>
</td>

```

The problem is, once I submit the form these select/option variables do not display their string results.

The process is working for one set of select/option sets which call their data from a database, but this example is calling their data from an array of strings as below :

```php

$hour = array("","00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24");
$minute = array("","00","30");

```

Is there something about arrays that is causing this issue?:huh:
