How to send 2 GET with input

Asked

Viewed 97 times

0

EXAMPLE:

<form action="/" method="get">
<input class="form-control mr-md-4" type="search" placeholder="Digite aqui oque deseja..." aria-label="Search" name="s" id="search" value="<?php the_search_query(); ?>">
<button type="submit"><i class="fas fa-search fa-1x" style="color: #3498db;"></i></button>
</form>

IT SENDS THE URL LIKE THIS: site.com/? s=SEARCH TERM

BUT I WANT TO LEAVE IT AT THAT: site.com/? s=SEARCH TERM & ref=app

WITH THE &ref=app at the end of the URL

1 answer

2


Put the ref=app in the attribute action of the form: For example:

action="pagina.php?ref=app"

Or you can also put this value in a input hidden, thus:

<input type="hidden" name="ref" value="app" />
  • But then it sends like this: page.php? ref=app? s=TERM.

  • It worked, thank you!

  • for nothing!......

Browser other questions tagged

You are not signed in. Login or sign up in order to post.