html - Price low - high / high - low filter PHP/Mysql -
i looking way create filter (select dropdown menu) selects products based on price.
i know possible query this:
select * products order price asc select * products order price desc but problem not want pass gets url select query.
is possible execute jquery command populate results?
this select:
<select name="filter"> <option value="lowhigh">price: low - high</option> <option value="highlow">price: high - low</option> </select> thanks in advance.
i see no reason not pass sort of query through get. still remains impossible inject/xss, there 2 options, without ability of user add his/her own information. sites ebay, amazon , etc. do. define variable other responders suggested. highly secure , recommend it. if wish use save user refreshing, use ajax - implemented in jquery default.
from html of:
<select id="filter"> <option value="lowhigh">price: low - high</option> <option value="highlow">price: high - low</option> </select> use jquery of:
$("#filter").change(function() { //whatever ajax wish use });
Comments
Post a Comment