Created
January 9, 2015 17:22
-
-
Save joeydsmith/2112c2826d1d8637c24d to your computer and use it in GitHub Desktop.
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
<?php | |
$url = 'https://secure.globalproblems-globalsolutions.org/site/CRDonationAPI?luminateExtend=1.4.3&method=getDonationFormInfo&form_id=9020&api_key=unfkey&response_format=json&suppress_response_codes=true&v=1.0'; | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, // return web page | |
CURLOPT_HEADER => false, // don't return headers | |
CURLOPT_FOLLOWLOCATION => true, // follow redirects | |
CURLOPT_ENCODING => "", // handle all encodings | |
CURLOPT_USERAGENT => "spider", // who am i | |
CURLOPT_AUTOREFERER => true, // set referer on redirect | |
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect | |
CURLOPT_TIMEOUT => 120, // timeout on response | |
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects | |
CURLOPT_SSL_VERIFYPEER => false // Disabled SSL Cert checks | |
); | |
$ch = curl_init( $url ); | |
curl_setopt_array( $ch, $options ); | |
$content = curl_exec( $ch ); | |
$err = curl_errno( $ch ); | |
$errmsg = curl_error( $ch ); | |
$header = curl_getinfo( $ch ); | |
curl_close( $ch ); | |
$header['errno'] = $err; | |
$header['errmsg'] = $errmsg; | |
$header['content'] = $content; | |
print_r($header); die; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment