Follow Redirects in cURL Scripts and KEEP POST Data
This commit is contained in:
parent
3be31c69e9
commit
21c91e7963
1 changed files with 1 additions and 0 deletions
|
@ -44,6 +44,7 @@
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
|
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects
|
||||||
|
curl_setopt($ch, CURLOPT_POSTREDIR, 3); // Keep posted data after redirects // https://stackoverflow.com/questions/35359720/php-with-curl-follow-redirect-with-post
|
||||||
|
|
||||||
//execute post
|
//execute post
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
|
|
Loading…
Reference in a new issue