If you are trying to control the browser, the best you are going to do is use the history object.
Something like..
<FORM>
<INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
</FORM>
In perl, you can do a header Location: redirect to whatever the logical last page was. i.e. if you have a 2.cgi, you can send a Location: 1.cgi to the browser instead if they submit with certain values. | [reply] [d/l] |
Most browsers will send the "referring" page in the HTTP request to get the new page. So assuming your Perl is running in a fairly standard CGI environment, you can get the URL of the referring page by looking at $ENV{HTTP_REFERER} and if defined, put it in a link when you create your page.
(Note spelling of referer, which doesn't look right to me as a Brit, is that the US spelling or is it just a mistake?).
| [reply] [d/l] |
| [reply] [d/l] |
Perl itself can't control anything in your browser. Perl just prints strings*. If a webserver runs the perl script, it takes the output of said script and sends it to the browser.
As the previous poster has pointed out, you need to output some HTML that includes some javascript that uses the history object. Or, if you know the URL of the previous page, you can use the Location header. Most browsers honor this request and send the browser to the page specified.
*This is an oversimplification of what perl does, but it's the fundamental function of Perl when used as part of the CGI.
"Get real! This is a discussion group, not a helpdesk. You post something, we discuss its implications. If the discussion happens to answer a question you've asked, that's incidental." -- nobull@mail.com in clpm
| [reply] |
Although this too is a non-perl suggestion, here is another even simpler way to access the previous page (history):
<a href=javascript:history.back()>BACK</a>
Best of Luck. | [reply] [d/l] |
thanks guys for the reply.. it worked already..
| [reply] |