Re: [PHP]cURL help needed
I am not entirely sure what you want to accomplish here: do you want to create a 'bot' that can automatically login on a webpage and be redirected? Or do you want 'normal' users to login and be redirected, while they stay logged in?
In the first case, you will have to resend the session cookie with each cURL request, provided your login is session based.
In the second case, forget about cURL and simply store their username/password in a session and verify it from there.
Re: [PHP]cURL help needed
Quote:
Originally Posted by
FragFrog
I am not entirely sure what you want to accomplish here: do you want to create a 'bot' that can automatically login on a webpage and be redirected? Or do you want 'normal' users to login and be redirected, while they stay logged in?
In the first case, you will have to resend the session cookie with each cURL request, provided your login is session based.
In the second case, forget about cURL and simply store their username/password in a session and verify it from there.
well first case is what i wanna do but not idea how anyone got a tip/example?
~passie
Re: [PHP]cURL help needed
As I said, you must use curl_setopt to store and resend the session cookie for each request. The easiest way to do this is set a temp file location where curl can store the session cookie. Either of these should work:
PHP Code:
curl_setopt($ch, CURLOPT_FILE, '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, '/cookie.txt');
If it's your own game you're probably easier off using server-to-server protocols like SOAP or XML-HTTP though.
Re: [PHP]cURL help needed
Quote:
Originally Posted by
FragFrog
As I said, you must use
curl_setopt to store and resend the session cookie for each request. The easiest way to do this is set a temp file location where curl can store the session cookie. Either of these should work:
PHP Code:
curl_setopt($ch, CURLOPT_FILE, '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, '/cookie.txt');
If it's your own game you're probably easier off using server-to-server protocols like SOAP or XML-HTTP though.
well Thanks!
~passie