Re: Equivalent of Back Button
| From: | Kris Dahl | Date: | Thu, 08 Jun 2000 18:38:22 +0000 |
| Subject: | Re: Equivalent of Back Button | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1320@lists.php.net to get a copy of this message | ||
on 6/8/00 11:57 AM, Nelson Weiderman at nhw@sei.cmu.edu wrote:
> I'd like to create a page that immediately goes back to the
> previous page, saving its state (equivalent to pushing the
> back button on the bowser). The following almost does what
> I want, but doesn't save the state:
>
> echo "<html><head><title>Admin Referer</title><META
> HTTP-EQUIV=\"refresh\" CONTENT=\"0; url=" . $HTTP_REFERER .
> "\"></head>";
>
> How do I do it?
Javascript, yo! This is a client functionality thing.
this should work:
?>
<html><body onLoad="window.back();"></body></html>
<?
But it is dependent on the client's implementation of javascript. Check
developer.netscape.com and msdn.microsoft.com for specific documentation.
or you could use something like this which is server side; kicks it back to
the refering page, but will have to redownload the page. So it would be
akin to hitting reload of the previous page than to the back button.
<? header("Location: $HTTP_REFERER"); ?>
-k