RE: [PHP] redirect without using header
| From: | pig pig | Date: | Thu, 14 Nov 2002 02:55:03 +0000 |
| Subject: | RE: [PHP] redirect without using header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124368@lists.php.net to get a copy of this message | ||
The problem I am expriencing now is intermittent.
Sometime the CGI error will appear and sometime it
works fine. Could it be the latency in the network
that is causing the problem? Just before the call to
header() there is a db query.
Any suggestion would be appreciated.
I have been trying for a few days and still getting
nowhere.
Thanks
CK Ong
--- Cal Evans <cal@calevans.com> wrote: > .
> .
> .
> ob_end_clean();
> header("Location: " . $sActionFileName);
> die();
>
> I always put a die() after my redirect headers
> unless I WANT it to continue
> processing for some reason. In the past I've had
> PHP not immediately
> redirect and it cause me problems.
>
> =C=
> *
> * Cal Evans
> * The Virtual CIO
> * http://www.calevans.com
> *
>
>
> -----Original Message-----
> From: pig pig [mailto:pigpig8080@yahoo.com.sg]
> Sent: Wednesday, November 13, 2002 7:47 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] redirect without using header
>
>
> function Order_action($sAction)
> {
> global $db;
> global $sForm;
> global $sOrderErr;
>
> $sParams = "";
> $sActionFileName = "ShoppingCart.php?";
>
> do some error checking
>
>
> //-- Create SQL statement
> $sSQL = "";
>
> //-- Execute SQL query
> $db->query($sSQL);
>
> ob_end_clean();
> header("Location: " . $sActionFileName);
> }
>
> It give the error below:
> CGI Error
> The specified CGI application misbehaved by not
> returning a complete set of HTTP headers. The
> headers
> it did return are:<p></p><pre></pre>
>
>
> Any help will be appreciated.
> Thanks in advance
> CK Ong
>
> --- pig pig <pigpig8080@yahoo.com.sg> wrote: > Hi
> Heilig,
> >
> > I have been trying to use the ob_start and
> > ob_end_flush(), but I am not sure where to put
> them.
> >
> > I try putting just before the header() but it
> still
> > produce the warning that something has been output
> > to
> > the browser.
> >
> > Thanks
> > CK Ong
> > --- "Heilig (Cece) Szabolcs" <cece@balaton.hu>
> > wrote:
> > > Hello!
> > >
> > > > I am getting an error by using header but I
> > > couldn't
> > > > find any part of my code that output anything
> > > before
> > > > using header.
> > >
> > > Check your included files what included before
> > using
> > > header();
> > > These files start with <? and ends with ?>
> without
> > > whitespace after that?
> > >
> > > And you can use ob_start() at the start and
> > > ob_end_flush() at the end,
> > > and no problems with outputting before add
> > headers.
> > >
> > >
> >
>
=============================================================
> > > Heilig (Cece) Szabolcs - cece@php.net -
> > > http://www.phphost.hu
> > >
> >
>
=============================================================
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> > http://www.php.net/unsub.php
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Great flight deals, travel info and prizes!
> > http://sg.travel.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
> __________________________________________________
> Do You Yahoo!?
> Great flight deals, travel info and prizes!
> http://sg.travel.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
__________________________________________________
Do You Yahoo!?
Play for a chance to win a trip to Sydney!
http://sg.mobile.yahoo.com