I found the solution: https://www.formget.com/how-to-redirect-a-url-php-form/
When doing the search it checks the term that was searched, so if it is equal to what I predefined, it directs:
Seeking:
echo'
<form method="get" action="/busca">
<input type="text" name="termo" placeholder="Procure por receita ou ingrediente...">
<button name="submit" type="submit" >Procurar</button>
</form>';
include($_SERVER['DOCUMENT_ROOT'].'/busca-receitas/direciona.php');
Make a "pre-consultation" before bringing the result
<?php
if(isset($_GET['submit'])){
$name = $_GET['termo'];
if($termo =='brasil'){ header("Location:http://componente.pratodoprato.com.br/pais/brasil");
}else{
header("Location:http://componente.pratodoprato.com.br/busca?termo=cebola");
}
}
?>
has recipes, it uses take the term and searches the list of ingredients (ingredients field), the query is: SELECT * FROM recipes WHERE ingredients LIKE '%termo_de_busca%'
– Leandro Marzullo
if you type search? term=flour goes to which page since flour should have in a lot of recipes
– user60252
alias, sorry, it searches in the fields ingredients, recipe name and countries, because you can choose by ingredient, recipe name and parents. It comes on the page that makes this query, brings all the recipes that use flour, but then I want to make a custom payment only for flour, for example
– Leandro Marzullo
is that I wanted to make it easier for the person, without her needing to click
– Leandro Marzullo
flour goes to the result that brings all the recipes that use flour
– Leandro Marzullo