I successfully logged in using curl.
$ch = curl_init('http://site.com/login');
// setting posts, cookies file, headers
curl_exec($ch);
Then, while logged in, I need to go to other page, lets say http://site.com/profit to do some stuff.
But how?
Should I run other php’s script with $ch = curl_init('http://site.com/profit'), or is it possible to do in one file? How it should be done?
You can use curl as many times as you want in the same PHP script. Be sure to call
curl_close($ch)between requests. Make sure that your cookie jar file (specified using CURLOPT_COOKIEJAR) is getting written to….