Toggle Sort Order on Hyperlink Click
Still need some help with sorting!!
Here is the new functionality that I added...
1.) The following Inbox Column Headings are hyperlinked: "From", "Subject", and "Date"
2.) When a User clicks on one of those links, the URL changes like this...
3.) By clicking on one of the Column Heading links, the page reloads and the Inbox messages are sorted accordingly.
(I think this all works well, and I used Tango and Fou's advice and incorporated variables into my Prepared Statements.)
Now, I would like to make it so that clicking on the same link toggles the Sort Order, BUT I don't want to add a "SortOrder" variable in the URL, so this should all be handled "behind-the-scenes" using a Session variable...
I found some hints online, BUT this is the problem that they don't account for...
The Sort Order should just change when a given link is clicked again and again, HOWEVER, the Sort Order should NOT change if the page is just re-loaded, e.g. hitting F5...
I've been playing around with some ideas using ternary conditions and the Session, but haven't figured things out yet, and could use some help.