Re: session example
| From: | ahmed@mazika.com | Date: | Sun, 30 Jul 2000 15:45:18 +0000 |
| Subject: | Re: session example | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9058@lists.php.net to get a copy of this message | ||
I think the header function has the same property as I tried it in the
middle of a script and it crashed, but how would I redirect a user
depending on an if decision ??
for example
if ( $x == 5 )
{
header ("Location: admin.php");
}
Thanks
On Sun, 30 Jul 2000 08:33:37 -0700, Erik Stainsby said:
> You must start the session before ANY output is sent to the browser.
> Even whitespace counts.
>
> Hope that helps.
>
> "ahmed@mazika.com" wrote:
> >
> > Hi All,
> > I have some problems with sessions in php4, sorry if this is a
> > repeated question.
> >
> > I have a simple page which I want to start tracking members from, so
> I
> > inserted session_start(), once I dont that I get this error when
> running
> > the script:
> >
> > Warning: Cannot send session cookie - headers already sent by
> (output
> > started at /usr/local/apache/htdocs/arabiccards/admin/index.php:10)
> in
> >
> > /usr/local/apache/htdocs/arabiccards/admin/index.php on line 11
> >
> > Warning: Cannot send session cache limiter - headers already sent
> by
> > (output started at
> > /usr/local/apache/htdocs/arabiccards/admin/index.php:10) in
> >
> > /usr/local/apache/htdocs/arabiccards/admin/index.php on line 11
> >
> > anybody may tell me whats that for ??
> >
> > Thanks
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>