RedRocky Posted January 14, 2010 Share Posted January 14, 2010 I am using Ajax to sort a table without having to reload the entire page. However, how can I rewrite the URL each time the page is sorted by a different column so that if the user reloads the page, or booksmarks the page, it will load up still sorted by the last column they sorted the data by? For example, at the moment, if the data table is sorted by forename, but the user clicks on the surname header to sort it by surname, and then the user hits the reload button of the browser, the data will once again be sorted by forename. I want it to reload the page still sorted by surname. How can I do this? Thanks, Stephen Quote Link to comment https://forums.phpfreaks.com/topic/188485-rewrite-url/ Share on other sites More sharing options...
dreamwest Posted January 16, 2010 Share Posted January 16, 2010 cookie or database session Quote Link to comment https://forums.phpfreaks.com/topic/188485-rewrite-url/#findComment-995927 Share on other sites More sharing options...
iScript Posted January 25, 2010 Share Posted January 25, 2010 Store the user's sorting expression in a session $_SESSION['sortOrder'] = $_GET['sortOrder']; /* the URL shoul'd be similar to "page.php?sortOrder=name" */ Or in a cookie: setcookie("sortOrder",$_GET['sortOrder']); Quote Link to comment https://forums.phpfreaks.com/topic/188485-rewrite-url/#findComment-1001212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.