curl on aspx with https
Sony AK <[email protected]>
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <[email protected]> |
Dear curl fans, I have curl code that login to an ASPX site. I am trying to run on my local machine and run succesfuly (can logged in succesfuly), but then I upload to GoDaddy and cannot run :( I upload to other hosting than GoDaddy and still cannot run. Any ideas? Here is the code. --------------- cut here ------------------ // do login $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://server.there.com/login.aspx"); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_REFERER, "https://server.there.com/login.aspx"); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, "__LASTFOCUS=" . $lastFocus . "&__EVENTTARGET=" . $eventTarget . "&__EVENTARGUMENT=" . $eventArgument . "&__VIEWSTATE=" . urlencode($viewState) . "&__EVENTVALIDATION=" . urlencode($eventValidation)); curl_setopt($curl, CURLOPT_ENCODING, ""); curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . '/cookies_temp.cookie'); curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . '/cookies_temp.cookie'); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)"); $curlData = curl_exec($curl); curl_close($curl); ------------ cut here ----------------- Best regards, Sony AK _______________________________________________ http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php