When a category and a tag is selected it works, but when i choose any tag + any categ i have to do the following tweak:
if( $cat == -1)
{
$url = $_POST["home_url"] . $tag;
}
else
{
$url = $_POST["home_url"] . $cat . $tag;
}
if( ($cat == -1) and ($tag == -1) )
{
$url = "https://www.guiagcr.com.br/estabelecimentos/";
}
elseif( ($cat != -1) and ($tag == -1) )
{
$url = "https://www.guiagcr.com.br/estabelecimentos/";
}