---------- Forwarded message ----------
From: Kelvin Park <[EMAIL PROTECTED]>
Date: Aug 18, 2007 4:34 PM
Subject: Re: [PHP] Cookies and sent headers
To: "M. Sokolewicz" <[EMAIL PROTECTED]>
the javascript code can definitely change to head("location: whatever.php")
for redirection, if that's the solution, that would be the way to go, but if
you're encountering quite similar problems later you can try ob_start() or
whatever that was recommended in the comments before M. Sokolewicz's
bullshitting comment.
On 8/18/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
>
> bullshit,
>
> what he sees is a warning emitted by PHP, his redirect is done using
> JavaScript (which is clientside and has no, 0.0 effect on what PHP
> emits). Now, I'm not going to go into how redirecting that way won't
> work (or at least shouldn't), but a hint would be to do it properly
> using header('Location: [...]') instead.
>
> - Tul
>
>
> Sanjeev N wrote:
> > Hi,
> > Its not the problem of cookies. Its problem of redirection or the
> > parent.location.replace function. I mean if you already output something
> on
> > the page and tries to redirect then this problem happens.
> >
> > Redirect before outputting anything on the page.. like space is also an
> > output.
> >
> > Warm Regards,
> > Sanjeev
> > http://www.sanchanworld.com/
> > http://webdirectory.sanchanworld.com - Submit your website URL
> > http://webhosting.sanchanworld.com - Choose your best web hosting plan
> > -----Original Message-----
> > From: Otto Wyss [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, August 18, 2007 2:56 PM
> > To: [email protected]
> > Subject: [PHP] Cookies and sent headers
> >
> > If built a simple login page and store any information within
> > $_SESSION's. Yet I'd like to move these into cookies but I always get an
>
> > error about sent headers. Is there a way to circumvent this problem
> > without changing too much in the page?
> >
> > The setting of the cookies happens just at the end of the page.
> >
> > if (!$errortext and $Anmelden) {
> > if (!empty($Permanent)) {
> > $expires = time()+ 365 * 86400; // 365 days
> > setcookie ("l.Lastname", $_SESSION['l_Lastname'], $expires);
> > setcookie (" l.Firstname", $_SESSION['l_Firstname'], $expires);
> > setcookie ("l.Email1", $_SESSION['l_Email1'], $expires);
> > setcookie ("l.Email2", $_SESSION['l_Email2'], $expires);
> > }
> > echo "<script type=\"text/javascript\">
> > parent.location.replace('$index_php";
> > </script>";
> > exit;
> > }
> >
> > O. Wyss
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>