Follow Redirects in cURL Scripts and KEEP POST Data

This commit is contained in:
earnolmartin 2018-05-20 00:52:26 -06:00
parent 3be31c69e9
commit 21c91e7963

View file

@ -44,6 +44,7 @@
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
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
$result = curl_exec($ch);