I am trying to make curl request to domain: http://xyz.com. here is my code.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_URL, $strURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $arrData);
curl_exec($ch);
While making request it gets redirected to some page within and don’t come back to my page.
How can i stop being redirected in middle of curl request.
M sorry guys…
after the suggestion i tried CURLOPT_FOLLOWLOCATION to 0 and it worked… it was my mistake that i didn’t remove next line of header redirection and it went on passing and passing…
sorry my mistake.
once more… CURLOPT_FOLLOWLOCATION to 0 wont transfer…
Try to play with :
CURLOPT_RETURNTRANSFER,CURLOPT_FOLLOWLOCATION,CURLOPT_COOKIEJAR,CURLOPT_COOKIEFILEAnd think to log, it’s easier to debug with it !