Re: simple-ish question but something i never knew
| From: | Zareef Ahmed | Date: | Sat, 10 Dec 2005 16:08:39 +0000 |
| Subject: | Re: simple-ish question but something i never knew | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-227271@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Robert Cummings" <robert@interjinn.com>
To: "Zareef Ahmed" <consultancy@indiaphp.com>
Cc: "Aaron Koning" <aaronkoning@gmail.com>; "PHP-General"
<php-general@lists.php.net>
Sent: Saturday, December 10, 2005 11:03 AM
Subject: Re: [PHP] simple-ish question but something i never knew
> On Sat, 2005-12-10 at 10:45, Zareef Ahmed wrote:
> > ----- Original Message -----
> > From: "Robert Cummings" <robert@interjinn.com>
> > To: "Aaron Koning" <aaronkoning@gmail.com>
> > Cc: "PHP-General" <php-general@lists.php.net>
> > Sent: Saturday, December 10, 2005 3:07 AM
> > Subject: Re: [PHP] simple-ish question but something i never knew
> >
> >
> > > On Sat, 2005-12-10 at 03:01, Aaron Koning wrote:
> > > > My experience was with the Location keyword, it might work better
with
> > the
> > > > Redirect keyword in the header function. I stopped using header and
> > Location
> > > > after a few problems and <meta> has never failed for me. MHO.
> > >
> >
> > > What kind of problems did you have? I've never experience a problem
with
> > > the location header, but would be interested to know of any gotchas
that
> > > I've just been fortunate enough to miss over the years.
> >
> > I do not think that using meta is better than header but header has one
> > problem ( but in my view it is feature) normally.
> > for eaxample:
> >
> > <?php
> > session_start();
> >
> > $_SESSION['somevar']="anything";
> > header("location:url");
> > ?>
>
> Shouldn't be a problem if you change it to:
>
> <?php
> session_start();
>
> $_SESSION['somevar']="anything";
> session_write_close();
>
> header("location:url");
>
> ?>
Yes indeed, but normally people do not know about this.
Alternatively we can reverse the script, I mean, we can write the header
line as first line of script.
Zareef Ahmed
>
> I generally wrap redirection in a function, that way any shutdown
> routines can be performed transparently -- and also the URL can be
> reworked from relative to absolute.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
>
====================================================
PHP Expert Consultancy in Development http://www.indiaphp.com
Yahoo! : consultant_php MSN : consultancy@indiaphp.com