0

I am trying to make a search bar in php with using the get array. This is my html code for the search bar:

<form action="index.php?page=searchproc" method="GET">
<input type="text" name="searchq" id="search" placeholder="Search"   maxlength="30"/>

</form>

When I enter the form, it goes to the url index.php?searchq=whateveriinputted, but I want it to go to index.php?page=searchproc?searchq=whateveriinputted. I have no idea what I have done wrong but the &page=searchproc just cancels itself.

Thanks, Raf

4
  • 1
    The action= GET parameter is discarded. Add an <input type=hidden> to preserve it. Commented Sep 11, 2015 at 0:39
  • GET is generally a bad idea for forms anyway. Commented Sep 11, 2015 at 0:41
  • @e4c5 I don't find anything wrong with GET for a search form. It makes it easier for users to share search results. I agree for login forms. Commented Sep 11, 2015 at 0:49
  • Search results are one exception to the rule, the very idea that such links can be shared is the reason that GET should not be used. Commented Sep 11, 2015 at 1:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.