Rahul Sitaram Johari wrote:
Chris wrote:
> Curl won't redirect you, you have to do it.
> header('Location: http://www.website.org');
But bear in mind that any cookies you've set up with curl will not be
there when you redirect the client since they're in your cookie jar not
on the clients machine, so if you're trying to do what I think you're
trying to do it won't work.
-Stut
Exactly!! And it doesn’t work!
Stut you’re absolutely right. I did indeed try the header('Location:
http://www.website.org'); directive in many different ways. When it
failed to work, I realized that the cookies that curl setup are stores
in the cookie jar, not the client browser/machine – therefore – the
redirection took me to the “unlogged-in” page, and not the “logged-in”
page of the website.
So what’s the work around?
If you really need to do this you need to do it with client-side
technology like activex so the cookies get set in the browser.
The only site I know that does this is egg.com, and they do it with an
activex control that runs an embedded IE control. Yes, it's IE only.
If all you want to do is log them in using a username and password that
you have simply fake the login form from the other site on your page
with hidden text fields, auto-fill it with the details and set the
action to the same place the login form on the other site submits to.
Then submit that form using javascript and boom, the user is logged in
to that other site.
Evil, nasty, insecure and other such stuff but that's how I'd do it if I
had to do it at all.
-Stut
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php