For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > May 2004 > Active 'back' buttons









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Active 'back' buttons
Rob Dixon

2004-05-22, 11:30 am

Hi guys.

What's the 'usual' way (if there is one) of implementing an 'active' back
button (which does the equivalent of the browser's back button but is
implemented in CGI code)?

If, say, I'm doing a database search and come up with a list of records,
each of which can be clicked on to provide the complete data for the single
record, how do I get back to the page with the list of records?

Obviously I can pass all the search criteria to the detail script and have
it pass them back again to repeat the search. But I know there must be a
better way to do it.

Thanks for any help.

Rob


Andrew Gaffney

2004-05-22, 11:30 am

Rob Dixon wrote:
> Hi guys.
>
> What's the 'usual' way (if there is one) of implementing an 'active' back
> button (which does the equivalent of the browser's back button but is
> implemented in CGI code)?
>
> If, say, I'm doing a database search and come up with a list of records,
> each of which can be clicked on to provide the complete data for the single
> record, how do I get back to the page with the list of records?
>
> Obviously I can pass all the search criteria to the detail script and have
> it pass them back again to repeat the search. But I know there must be a
> better way to do it.
>
> Thanks for any help.


<a href="java script:window.location.back()"><-- Go back</a>

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548

James Kipp

2004-05-22, 11:30 am

>
> Hi guys.
>
> What's the 'usual' way (if there is one) of implementing an
> 'active' back
> button (which does the equivalent of the browser's back button but is
> implemented in CGI code)?
>


It is usually done with javascript and pretty easy to do. Although you may
already be aware of this and looking for a perl solution.

Wiggins D'Anconia

2004-05-22, 11:31 am

Rob Dixon wrote:
> Hi guys.
>
> What's the 'usual' way (if there is one) of implementing an 'active' back
> button (which does the equivalent of the browser's back button but is
> implemented in CGI code)?
>
> If, say, I'm doing a database search and come up with a list of records,
> each of which can be clicked on to provide the complete data for the single
> record, how do I get back to the page with the list of records?
>
> Obviously I can pass all the search criteria to the detail script and have
> it pass them back again to repeat the search. But I know there must be a
> better way to do it.
>
> Thanks for any help.
>
>


Alternatively, if James and Andrew didn't get you there, possibly
because you want to nest multiple levels, I have used cookies for this
purpose. For instance if you attach a discussion forum to the detail
record of a search listing, then if a user goes to the detail record,
then to any number of postings in the forum they will lose their search
link. You could pass it around in links but I feel it is easier to
throw a cookie at the user when they hit the search results, then at any
point I know the last search result seen. I use the same code to set a
cookie for the detail record so that cruising around the forum will also
take them back to the record. Naturally these are session cookies, and
I am not terribly picky about dropping (l)users that don't have cookies
enabled. Mileage may vary....

http://danconia.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com