Re: header() question
| From: | martinahingis | Date: | Mon, 01 Apr 2002 20:47:45 +0000 |
| Subject: | Re: header() question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91021@lists.php.net to get a copy of this message | ||
I think the question is not the top of the page, the top frame of the
window. Isn't it?
If so you should use Javascript instead of PHP.
<script language="JavaScript1.2">
top.window.location.href=http://yoursite.com/yourpage.php;
</script>
-------
martina.
"Erik Price" <pricee@hhbrown.com> wrote in message
news:CE561E18-45A5-11D6-95B7-0050E4857868@hhbrown.com...
>
> On Monday, April 1, 2002, at 01:49 PM, Patrick Hartnett wrote:
>
> > So any use of header("Location=...") automatically does what amounts to
> > a target="_top"? If so, then ignore this entire post, cuz that answers
> > the question. If not, does anyone know how to force a target="_top"
> > when using header("Location=...")?
>
> Why not just create an anchor ID at the top of the page, and then make
> the header argument point to that? This will work on more browsers than
> "_top" anyway. Like so:
>
> // this is the HTML page you want to point to
> <!DOCTYPE xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>Test</title>
> <!-- other head info goes in here -->
> </head>
> <body>
> <a id="topofpage" />
>
>
> <!-- other content of page goes here -->
> </body>
> </html>
>
> // and this is your PHP code
> header('Location:
> http://www.domain.com/testpage.php#topofpage');
>
>
>
>
> HTH,
>
> Erik
>
>
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee@hhbrown.com
>