$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_MAXREDIRS, 0); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_REFERER, $url_ref); curl_setopt($ch, CURLOPT_HTTPHEADER, $the_headers); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_str); $response = curl_exec($ch); curl_close($ch); drew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
This login script works when I use Snoopy (php http class), but here
with php curl the response is the redirected page. The script is
following a 302 redirect and I don't want it to because I need some
header info from the 302 page. The curl_setopt($ch,
CURLOPT_MAXREDIRS, 0); doesn't seem to be preventing redirect:
- [PHP] cURL: can't prevent url redirect Andrew Warner
- Re: [PHP] cURL: can't prevent url redirect Chris
- Re: [PHP] cURL: can't prevent url redirect Richard Lynch
- Re: [PHP] cURL: can't prevent url redirect Andrew Warner
- Re: [PHP] cURL: can't prevent url redirect Chris
- Re: [PHP] cURL: can't prevent url redirect Richard Lynch
- Re: [PHP] cURL: can't prevent url redirect Andrew Warner