Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Tenho a seguinte página
http://localhost/app/admin/properties
E alguns filtros para a query, como por exemplo:
<UL CLASS="dropdown-menu">
<LI><a href="/app/admin/properties?limite=25" title="Valor Recomendado!">25</a></LI>
<LI><a href="/app/admin/properties?limite=50">50</a></LI>
<LI><a href="/app/admin/properties?limite=100">100</a></LI>
<LI><a href="/app/admin/properties?limite=250">250</a></LI>
<LI><a href="/app/admin/properties?limite=all">Todas</a></LI>
</UL>
e outra
<UL CLASS="dropdown-menu">
<LI><a href="/app/admin/properties?select=featured">Destaques</a></LI>
<LI><a href="/app/admin/properties?select=hide">Ocultos</a></LI>
<LI><a href="/app/admin/properties?select=venda">Para Venda</a></LI>
<LI><a href="/app/admin/properties?select=aluguel">Para Aluguel</a></LI>
<LI><a href="/app/admin/properties?select=default">Padrão</a></LI>
</UL>
Gostaria de saber se tem como e de que forma implementar isso.
Clicando nas opções a url mantenha a variável atual e adicione a nova, por exemplo:
tenho essa url
[http://localhost/app/admin/properties?select=hide](http://localhost/app/admin/properties?pag=1)
ao clicar no botão para alterar o limite a url mantenha a variável select como está e adicione a nova ficando assim:
[http://localhost/app/admin/properties?select=hide&limite=50](http://localhost/app/admin/properties?pag=1)
Seria igual a forma como o PHPMYADMIN funciona.
De que forma posso fazer isso?>
18 horas atrás, Williams Duarte disse:
Se você tiver certeza que sempre havera a query select, use a função [http_build_query](http://sg.php.net/manual/en/function.http-build-query.php), senão tiver use [stropos](http://php.net/manual/pt_BR/function.strpos.php) para verificar se existe o sinal "?" de interrogação na URL , se existir use a função [http_build_query](http://sg.php.net/manual/en/function.http-build-query.php) para ir montando a nova URL com
$_SERVER['REQUEST_URI']
Era exatamente isso o que precisava;
Muito Obrigado!