hi again,
I figure I need some php as a posthook. I am calling a post hook sendiContact, and i have this in my snippet, based on this post.
I know it’s wrong; I’m just hoping someone with more php / modx knowledge than I have can tell me where it’s wrong.
<?php
define(’POSTURL’, ’
https://app.icontact.com/icp/signup.php’);
define(’POSTVARS’, ’listID=16599&specialid:16599=AE7L&clientid=162410&formid=1167&reallistid=1&doubleopt=0&feilds_email&feilds_fname&feilds_lname’); // POST VARIABLES TO BE SENT
// INITIALIZE ALL VARS
$Email=’’;
$ch=’’;
$Rec_Data=’’;
$Temp_Output=’’;
if($_SERVER[’REQUEST_METHOD’]===’POST’) { // REQUIRE POST OR DIE
if(isset($_POST[’EmailAddress’])) $Email=$_POST[’EmailAddress’]; // GET EMAIL INTO VAR
$feilds_email = $hook->getValue(’email’);
$feilds_fname = $hook->getValue(’fullname’);
$feilds_lname = $hook->getValue(’lastname’);
$feilds_weddingdaye = $hook->getValue(’weddingday’);
$email = $hook->getValue(’weddingmonth’);
$email = $hook->getValue(’weddingyear’);
$ch = curl_init(POSTURL);
curl_setopt($ch, CURLOPT_POST ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS ,POSTVARS.$Email);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER ,0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
$Rec_Data = curl_exec($ch);
ob_start();
header("Content-Type: text/html");
$Temp_Output = ltrim(rtrim(trim(strip_tags(trim(preg_replace ( "/\s\s+/" , " " , html_entity_decode($Rec_Data)))),"\n\t\r\h\v\0 ")), "%20");
$Temp_Output = ereg_replace (’ +’, ’ ’, trim($Temp_Output));
$Temp_Output = ereg_replace("[\r\t\n]","",$Temp_Output);
$Temp_Output = substr($Temp_Output,307,200);
echo $Temp_Output;
$Final_Out=ob_get_clean();
echo $Final_Out;
curl_close($ch);
} else die(’Hacking attempt Logged!’);
exit;
/* tell our snippet we’re good and can continue */
return true;