RE: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?
| From: | Jason Murray | Date: | Wed, 27 Mar 2002 05:23:19 +0000 |
| Subject: | RE: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90319@lists.php.net to get a copy of this message | ||
Or, alter your page's structure so that it writes its output into a
buffer, and echo/print it at the end of the page. That way you can
do the redirect at any point it's needed within the page logic.
Jason
--
Jason Murray
jasonm@melbourneit.com.au
Web Developer, Melbourne IT
"Work now, freak later!"
> -----Original Message-----
> From: webapprentice [mailto:webapprentice@onemain.com]
> Sent: Wednesday, March 27, 2002 4:25 PM
> To: Rasmus Lerdorf
> Cc: James; Jason Murray; php-general@lists.php.net
> Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
> location tag?
>
>
> Hi Mr. Lerdorf,
> I look forward to you upcoming O'Reilly PHP book. =)
>
> Yes, a META tag refresh or Javascript control seems to be the
> only way left.
> Strange that URL redirection is so unusual to implement in
> PHP compared to
> ASP or Coldfusion (unless they do something klunky under the hood).
>
> Anyway, I also noticed that when the manual says you cannot
> output ANYTHING,
> I found out that if I close out all my spaces in the PHP page
> by tightening
> the php container tags, I will not output anything first. I
> forgot that
> even whitespace would be considered a web page and would generate http
> headers (since the PHP processor probably translates whitespace as
> echo/print statements).
>
> Thanks.
>
> --Stephen
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus@lerdorf.ca>
> To: "webapprentice" <webapprentice@onemain.com>
> Cc: "James" <james@aipmedia.com.au>; "Jason Murray"
> <Jason.Murray@melbourneit.com.au>; <php-general@lists.php.net>
> Sent: Wednesday, March 27, 2002 12:01 AM
> Subject: Re: [PHP] Any PHP equivalent of Macromedia
> ColdFusion's location
> tag?
>
>
> > So use a Javascript meta-refresh
> >
> > On Wed, 27 Mar 2002, webapprentice wrote:
> >
> > > Hi,
> > > Thanks for the reply. I saw this as well in the mailing
> list archives,
> but
> > > everyone is saying you cannot output ANYTHING before
> calling header.
> > >
> > > Unfortunately, I'm calling this at the end of a process,
> so it won't
> work.
> > > It tells me I've already sent out header information.
> > >
> > > I've basically created a single PHP page with a form.
> When the form is
> > > submitted, it submits to itself. It checks if the form
> is submitted,
> and
> > > then goes to mail the contents to someone. After
> mailing, I want to go
> to a
> > > Thank You page. I want to get away from this PHP page,
> because I don't
> want
> > > a person refreshing the page and causing the PHP page to
> submit again.
> > >
> > > Thus, is there something else I can do? Or am I just not
> seeing this?
> > >
> > > Thanks,
> > > Stephen
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "James" <james@aipmedia.com.au>
> > > To: "webapprentice" <webapprentice@onemain.com>
> > > Sent: Tuesday, March 26, 2002 10:20 PM
> > > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
> location
> > > tag?
> > >
> > >
> > > > header("Location: http://www.google.com");
> > > > replace that url with the page you want it to go to
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>