‘ . date(‘c’) . ‘

data:,none

Contact



‘ . $email . ‘
‘ . $firstName . ‘
‘ . $lastName . ‘
ACTION_BY_CONTACT

‘ // Do this for all the lists you want to add to
//. ‘‘ // Be sure to get the correct list number(s) for your list(s)
. ‘



‘;

// Initialize the cURL session
$request =”https://api.constantcontact.com/ws/customers/” . $UN . “/contacts”;
$session = curl_init($request);

// Set up digest authentication
$userNamePassword = $Key . ‘%’ . $UN . ‘:’ . $PW ;

// Set cURL options

curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
//curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($session, CURLOPT_USERPWD, $userNamePassword);
curl_setopt($session, CURLOPT_POST, 1);
curl_setopt($session, CURLOPT_POSTFIELDS , $entry);
curl_setopt($session, CURLOPT_HTTPHEADER, Array(“Content-Type:application/atom+xml”));
curl_setopt($session, CURLOPT_HEADER, false); // Do not return headers
curl_setopt($session, CURLOPT_RETURNTRANSFER, 1); // If you set this to 0, it will take you to a page with the http response

// Execute cURL session and close it
$response = curl_exec($session);

curl_close($session);

$pos = strpos($response,”Error”);

if($pos === false) {
echo “Thanks! Check Your Email. Your DemGen Small Business Growth Toolkit Is On It’s Way.”;

//echo “

You can also download it directly from the link below:”;

//echo “

DemGen Small Business Growth Toolkit (Right Click and select Save Link As)

“;

$to1 = “pamc@demgen.com”;
$to2 = “infocuspub@gmail.com”;
$subject = “New DemGen Small Business Growth Toolkit Lead”;
$body = “Lead Details:\n\nName: $name\n\nEmail: $email\n\n”;
$headers = “From: info@demgen.com\r\nReply-To: $email”;
if (mail($to1, $subject, $body, $headers)) {
sleep(1);
mail($to2, $subject, $body, $headers);
//echo(“Email notification successfully sent…”);
} else {
echo(“

Email notification failed…”);
}

}
else {
echo “There seems to have been a problem with the form submission:
“;
echo $response;

echo “

Please click the back button and try again”;

echo “

or”;

echo “

Email info@demgen.com to request the Small Business Growth Toolkit”;

}

}

else{

echo “

There seems to have been a problem with the form submission.”;

echo “

Please call email info@demgen.com to request the Small Business Growth Toolkit”;

}

?>