Re: [PHP] http_request



Also, supply an absolute URL when using header redirects.

On Jan 5, 2008 3:44 PM, Daniel Brown <parasane@xxxxxxxxx> wrote:

On Jan 5, 2008 9:06 AM, peeyush gulati <peeyushgulati@xxxxxxxxx> 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




Relevant Pages

  • Re: Forms Based Authentication and the OpenWave Browsers
    ... Try taking this redirect out of the try...catch; ... > Authentication in cookie enabled WAP browsers. ... > Samsung Browser, Forms Authentication and RedirectFromLoginPage - This is ... > Open Wave Browser and Cookies - While regression testing my new change, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • a method for bypassing cookie restrictions in web browsers
    ... privacy settings that restrict cookies or disable them altogether. ... will be cached by the browser. ... Both headers can be however, if initially chosen to be unique for every ... completely disabling or severily impairing document caching in general, ...
    (Bugtraq)
  • [Full-Disclosure] a method for bypassing cookie restrictions in web browsers
    ... privacy settings that restrict cookies or disable them altogether. ... will be cached by the browser. ... Both headers can be however, if initially chosen to be unique for every ... completely disabling or severily impairing document caching in general, ...
    (Full-Disclosure)
  • [Full-Disclosure] a method for bypassing cookie restrictions in web browsers
    ... privacy settings that restrict cookies or disable them altogether. ... will be cached by the browser. ... Both headers can be however, if initially chosen to be unique for every ... completely disabling or severily impairing document caching in general, ...
    (Full-Disclosure)
  • [Full-Disclosure] a method for bypassing cookie restrictions in web browsers
    ... privacy settings that restrict cookies or disable them altogether. ... will be cached by the browser. ... Both headers can be however, if initially chosen to be unique for every ... completely disabling or severily impairing document caching in general, ...
    (Full-Disclosure)