PHP – Post Action

<form method="post" action="/page/?foo=ABC">
    <select name="foo">
        <option value="ABC">ABC</option>
        <option value="DEF">DEF</option>
    </select>
    <select name="bar">
        <option value="GHI">GHI</option>
        <option value="JKL">JKL</option>
    </select>
    <input id="search" type="text" placeholder="Search">
    <input type="submit" value="">
</form>

I have the above form on a WordPress site. If I go to /page/?foo=ABC, this page shows me everything as it should where foo = ABC.

What do I need to set the action as to get the option from the select?

Related posts

2 comments

  1. Your form needs to use GET instead of POST:

    <form method="get" action="/page/">
    

    Then then all the inputs will be appended to the URL in the manner you seek.

Comments are closed.