Page 1 of 1

[SOLVED] last page link

Posted: Thu Feb 17, 2005 5:37 pm
by sweenyman
Hi
I'm trying to make a link that refers back to the last page but the last page contained a db query with various variable values.I think I could append the query details to the link but is that safe. What are my options.
Any help appreciated.
Sean

Posted: Thu Feb 17, 2005 5:40 pm
by feyd
store the previous page information you need in a session or set of session variables.

Posted: Thu Feb 17, 2005 5:54 pm
by sweenyman
feyd wrote:store the previous page information you need in a session or set of session variables.
Yeah I tried that
if(!$_SESSION["backwards"]){
$_SESSION["backwards"]=$qry;
}
I have lots of links calling the one script so the sql differs each time.
I have one page up that has been generated by a query then when I click a link on that page calling the same script, the query is then overwritten by that qry so the last one is lost and I cant get back
If that makes sense
Sean

Posted: Thu Feb 17, 2005 6:39 pm
by feyd
what about storing a history if you need to go back farther? Or the Javascript history object...

Posted: Thu Feb 17, 2005 6:47 pm
by sweenyman
feyd wrote:what about storing a history if you need to go back farther? Or the Javascript history object...
Hi
I tried using javascript:history.go(-1) which strangely works in other parts of my site in similar circumstances but not here
Anyway I got it figured out in the end with a few if's in the right places

Thanks for you quick response and help
Sean