Integrating Signup with PHP Contact Form

Occasional Participant

Integrating Signup with PHP Contact Form


We are attempting to integrate Constant Contact e-list signup as an option in our standard website inquiry form, as opposed to having two separate forms. We have solid HTML background, but only pretty basic PHP knowledge, and have been using Tectite FormMail for our form processing (

It doesn't look like the PHP Custom Signup Form utility fits the bill -- my understanding is that this automatically adds whoever fills out the form into our CC list, whereas we want to be able to use the same form for people who wish to simply make an inquiry and not be added to the list.

I was able to upload the PHP Sample Signup Forms to our server, and have those running just fine -- but, again, I'm not sure how to modify them to conditionally only add people to the CC database if they have indicated that they'd like to be added. 

Am I overlooking something with these samples that would allow us to easily get this functionality? If not, has anyone come up with a modification to a standard PHP processing script that adds this sort of conditional functionality? Ideally we'd like a mod to the Tectite script, since it's pretty powerful and has good anti-spam features built in as well, but we might be open to other possibilities.

Thank you! 




What you are looking to do is definetly possible with our API's. However, it usually does require some experience with a scripting language like PHP.

You can actually do this within your current code, just making a conditional IF statement, that if a checkbox is checked, create Contact XML with the information the person entered into the form, and then submit it using an HTTP request.

We have a PHP wrapper library that can be found here, that has functions that create the XML for you by passing an array of the data that the user submits. There is also a function that then submits that XML to our API server.

If you have any questions about this, please feel free to ask and we can do our best to help you along the way.


Benjamin Soder
NOC Analyst
Constant Contact
Occasional Participant

Thanks for the reply. Unfortunately, I don't have much first-hand experience with coding PHP -- I can follow instructions for changing variables within a script, but I have no idea how to write a conditional IF statement, let alone call the other conditional functions afterwards. I appreciate the tools that CC does offer, but it seems like they don't quite get less code-savvy users where they need to be -- which would be offering a streamlined experience for users of our site, while still being mindful of not adding users to a mailing list without their outright consent. Are there any plans to update CC's sample code with an opt-in/opt-out checkbox like this that would expand the potential uses? Or has anyone else figured this out who would be willing to share? I've tried looking at the Marketplace, but I'm having a hard time quickly picking out people who specialize in this sort of thing.

Thanks again!

Developer Portal

View API documentation, code samples, get your API key.

Visit Page