Re: [PHP] http_request
- From: buddhamagnet@xxxxxxxxx ("Dave Goodchild")
- Date: Sat, 5 Jan 2008 15:59:32 +0000
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 toapplication.
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
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
- Follow-Ups:
- Re: [PHP] http_request
- From: "Daniel Brown"
- Re: [PHP] http_request
- References:
- http_request
- From: "peeyush gulati"
- Re: [PHP] http_request
- From: "Daniel Brown"
- http_request
- Prev by Date: Re: [PHP] http_request
- Next by Date: Re: [PHP] http_request
- Previous by thread: Re: [PHP] http_request
- Next by thread: Re: [PHP] http_request
- Index(es):
Relevant Pages
|