Anyone help me with CURL?
Here is the issue:
I need to send some values through the post method from an interim page.
The form is submitted, data written to csv (which is working fine), then I need to send the same data to an email collection page outside of my domain.
The following script returns a page that says "Object Moved to here", "here" being a link to the actual page that needs to load. http://www.serenocan...om/thankyou.htm
$SubscribeDate = date("F j, Y"); $fname = $_POST['fname']; $lname = $_POST['lname']; $emailAdd = $_POST['emailadr']; $source = $_POST['source']; $thx = $_POST['thx']; //http://www.serenocanyon.com/thankyou.htm $err = $_POST['err']; $usub = $_POST['usub']; $postArray = "First Name=".urlencode($fname)."&Last Name=".urlencode($lname)."&Email Address=".urlencode($emailAdd)."&Source=".urlencode($source)."&thx=".urlencode($thx)."&err=".urlencode($err)."&usub=".urlencode($usub)."&Subscribe Date=".urlencode($SubscribeDate); $url = "http://cl.exct.net/subscribe.aspx?lid=1220593"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postArray); $results = curl_exec($ch); echo $results; curl_close($ch);
Why is this happening?
Any help would be MUCH appreciated.