[SOLVED] last page link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

[SOLVED] last page link

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

store the previous page information you need in a session or set of session variables.
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what about storing a history if you need to go back farther? Or the Javascript history object...
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

Post 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
Post Reply