Also, supply an absolute URL when using header redirects.

On Jan 5, 2008 3:44 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Jan 5, 2008 9:06 AM, peeyush gulati <[EMAIL PROTECTED]> wrote:
> > Greetings on New Year :)
>
>    To you, as well!
>
> > We have a script, say layer.php, which uses HTTP_REQUEST package to
> > authenticate a user to an existing application (viz., wordpress,
> > mediawiki etc.)
> >
> > I would like help on the following two fronts:
> >
> > 1. How do I return the cookies, headers etc. from the layer (which are
> > being sent from the application) to the browser?
> > 2. How do I redirect browser from the layer.php to a page of the
> application.
> >
> >
> > I was thinking that if I could find a way to send the headers and
> > cookies to the browser, I could also send a 302 status code, along
> > with the cookies, to redirect the user to a page of the app.
>
>    When you create a cookie in your script, it is automatically sent
> via the HTTP server to the client (browser).  The same occurs with
> $_SESSION information, as the PHPSESSID cookie is sent to the browser
> to track the session name.
>
>    With regard to redirection, there are a lot of ways to do that,
> but the easiest is as follows:
>
> <?
> header("Location: somefile.php");
> exit;
> ?>
>
>    Just be sure to always exit; after using the header("Location:
> xxx"); to stop the current script from running, unless you have
> explicit reasons not to do so.
>
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to