Last active
September 10, 2015 17:16
-
-
Save veb/7ce56bf09a2cc8e5f0f6 to your computer and use it in GitHub Desktop.
articles-11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// original curl request up here | |
if ($headers['http_code'] == 302){ | |
$ch = @curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $headers['redirect_url']); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); // set cookie file to given file | |
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); // set same file as cookie jar | |
$content = curl_exec($ch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment