I have a URL : foo.php?name=adam&lName=scott
, and in foo.php
I have a form which gives me values of rectangleLength
& re
Once, I needed sorting the results in a table keeping the search results coming from GET. I did like that:
unset($_GET['sort']); // sort param is removed, otherwise there will be created many sort params
$url = http_build_query($_GET);
echo "<a href='?".$url."&sort=title'>Title</a>";
echo "<a href='?".$url."&sort=author'>Author</a>";