I need insert data in a database and search in one input. All at once.
I used method="post"
because the input with name="q"
insert data in database with $_POST
. But i need use $_GET + $_POST
in this form.
My index.php
<form action="search.php?q=<?php echo $_GET['q']; ?>" method="post" autocomplete="off">
<input
required
dir="ltr"
name="q"
class="input is-large"
type="text">
<p> </p>
<input type="submit" class="button is-color is-large" value="Buscar" name="go">
</form>
So, i am trying use $_GET['q']
to complete the form action with content of input. But not working.
I need that url stay like this: search.php?q=CONTENT OF INPUT
after submit.