-2

I have a main layout page with a bit of logic to check for particular $_GET variable and redirect to a page based on that value.

I have added a simple form into one of the php included pages. When I set my form method to either POST or GET I get no values returned, however, if a put a link on the same page, I get all GET variables.

Here's a test code for both, the link and the form. What am I missing?

<a href="./?do=busSearch&zzz=999">Test link</a>

<form action="./?do=busSearch" method="POST">
    <label for="displayLimit">Display Limit</label>
    <select id="displayLimit" class="form-control">
        <option value="5">5</option>
        <option value="10">10</option>
        <option value="15">15</option>
        <option value="20">20</option>
    </select>
    <input type="submit" value="Update" class="btn btn-primary mar20top">
</form>
santa
  • 12,234
  • 49
  • 155
  • 255

1 Answers1

1

None of your form elements have name attributes. The browser uses that attribute as the key in the key/value pairs when submitting the form. Simply add some:

<select id="displayLimit" class="form-control" name="someSelectElement">
David
  • 208,112
  • 36
  • 198
  • 279