Does anyone know of a better back link in php than the normal javascript history one, specifically when pulling from mysql and clicking on a result in a list then a back button to go back to that exact list. I want to use pagination but even just a back link to the list would be great.
Thanks for any input
Well, you'd basically have the option of using the Javascript back method, or build a link that contains a variable in the link to signify the exact list, so your code could parse that and rebuild your list like it was done originally.
You can use $_SERVER['HTTP_REFERER']..i'm not really sure of any other way.
that's what I thought you'd say
how does this work?
cheerio wrote:You can use $_SERVER['HTTP_REFERER']..i'm not really sure of any other way.
echo "http://" . $_SERVER["HTTP_HOST"] . "/" . basename($_SERVER["HTTP_REFERER"]);
Not really reliable, but neither is relying on javascript. 😉
How reliable is the browser's back button? 🙂
Right on Weed, but in the interest of designing an interface that immerses people to the point of being able to avoid the browser's buttons (as a whole)... humor them... That's one thing that makes for a great design element isn't it?
Maybe. But personally I notice I've never used such a facility even when it was available; my first reaction to wanting to "go back a page" is always to hit backspace or alt-left.