i want to make a link toggle the sort order. i am using variable $order for the purpose. when i click once the link the href should be “?order=desc” then again when i click it should be “?order=asc”. hoping for help.
if ( isset($_GET['order'])) { $order == $_GET['order']; }
else { $_GET['order']=='asc'; }
$order = $_GET['order'];
<a href="?<?php if ($order='desc'){echo 'order=asc';}else {echo 'order=desc';}?>">order </a>
hope some body here could help me out with the above code ?
something like that: