Hi guys!
My friend is trying to get more people to sign up for his newsletter on ConstantContact, but he also wants to get visitor feedback mailed directly to him.
I have his HTML form posting to a PHP file on the server. That PHP is currently 1/2 working, as it successfully sends an email to me with the visitor comments in it. Now, I just need it to also send the 4 variables along to ConstantContact.
If it was an HTML form directly posting to ConstantContact, the action would be: "action="http://visitor.r20.constantcontact.com/d.jsp" but it is PHP, so I assume the syntax is different.
And here is my current PHP file that is successfully 1/2 working:
= 'Customer Has a Question!'= 'barry@page3design.com'= $_POST[= $_POST= $_POST= $_POST= $_POST= <<<EOD
<br<hr><br>
Email: $ea <br>
Comments: $comments <br>
<br>
And below are the four variables sent to Constant Contact:<br>
Email: $ea <br>
LLR: $llr <br>
M: $m <br>
P: $p <br>
<br>
These comments were sent from the test.html page of the JW Secure site. <br>
The visitor has checked the box that would send their information to Constant Contact.<br>
EOD;
$headers = "From: $ea\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
$theResults = <<<EOD
<META http-equiv="refresh" content="0;URL=http://www.jwsecure.com/contact/thank-you/">
EOD;
echo "$theResults";
?>
And if it helps, here is the form from the HTML. The hidden variables are just things for ConstantContact, so we have values for each of those, we just need to pass them along to CC.
<form action="SendToConstantContact.php" name="myform" method="post" onsubmit="return submitForm(this)">
Your email*:<br/>
<input type="text" name="ea" size="39" value="" style="font-size:10pt;"><br/>
<img src="images/transparent.gif" width="1" height="9" alt="" border="0" /><br/>
Your message (optional):<br/>
<textarea name="comments" cols="30" rows="3" style="font-size:10pt;">
</textarea><br/>
<img src="images/transparent.gif" width="1" height="9" alt="" border="0" /><br/>
<input type="hidden" name="llr" value="z4u4kndab">
<input type="hidden" name="m" value="1103180583929">
<input type="hidden" name="p" value="oi">
<input type="submit" value="Submit" />
</form>
So, my question is, how do I do 2 things in my PHP file? 1. send the email to Dan (this part is working) and 2. also send the variables to ConstantContact via this PHP page (I need help with this part)?
I've tried to find the answer on PHP sites but so far it has eluded me. Thank you for your time and expertise.
-Barry