Hi,
Sorry if this is a really basic question; however, I am a curl newbie. I have managed to successfully login to a secure page using a webform; however, I can't seem to navigate to a different page after I've logged in.
Currently, I am using this:
$loginName = 'login';
$password = 'password';
$cookie = 'cookiefile';
$postdata = 'loginName='.urlencode($loginName).'&password='.urlencode($password);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,"https://www.domain.com/main/loginConfirm");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_TIMEOUT, 20);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
curl_close($ch);
I'm not sure how I now go to a different page in the secure area. Everytime I try to access a page it redirects me to the login window.
Hope I'm making myself clear,
Thanks,
slevytam