Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2016 14:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
MAMP + Wufoo API
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Wufoo Demo</title>
<!-- Latest compiled and minified CSS from Bootstrap so the page don't look like ass -->
<link rel="stylesheet" href="" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<div class="container">
<h1 class="page-header">Wufoo Demo</h1>
$curl = curl_init(''); //1
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //2
curl_setopt($curl, CURLOPT_USERPWD, 'AOI6-LFKL-VM1Q-IEX9:footastic'); //3
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); //4
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Wufoo Sample Code'); //5
// ssl configurations required to make MAMP play nice
curl_setopt($curl, CURLOPT_SSLVERSION, 1);
curl_setopt($curl, CURLOPT_SSL_CIPHER_LIST, 'TLSv1');
$response = curl_exec($curl); //6
$resultStatus = curl_getinfo($curl); //7
if($resultStatus['http_code'] == 200) { //8
echo htmlentities($response);
} else {
echo 'Call Failed '.print_r($resultStatus); //9
// more error info
// $curlError = curl_error($curl);
// echo $curlError;
</div><!-- end of container -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment