Not Adding Contact

Occasional Participant

Not Adding Contact

 I'm testing your API on my desktop with Windows 7 and IIS running PHP 5.3.5

Using your sample simple_form.php with cc_class.php works just fine.  I can verify the hits to my account.  Great!

But when I copy your code into my custom form in same directory and same cc_class.php, it's not working. 

My file is the action/response screen to about a dozen slightly different input forms.  Those forms are all straight HTML, outside contractor, not my responsibility.  So I'm filtering the inputs on my page.  My code should look familiar:

if (!empty($_POST)) {

$postFields = array();

$postFields = HTMLSpecialChars($_POST, ENT_QUOTES, 'UTF-8');

$postFields = HTMLSpecialChars($_POST, ENT_QUOTES, 'UTF-8');

$postFields = HTMLSpecialChars($_POST, ENT_QUOTES, 'UTF-8');


Another change I make is references to unused fields in $postFields throw "undefined index" errors, so I initialize them to null strings such as: $postFields = "";

The rest of it should be familiar

$contactXML = $ccContactOBJ->createContactXML(null,$postFields);

if (!$ccContactOBJ->addSubscriber($contactXML)) {

$error = true;

} else {

$error = false;

$_POST = array();


For testing, I display $contactXML out of both my page and simple_form.php.  It looks the same in each.  Yet simple_form is working, and mine isn't.  Are these changes I mention screwing me up?  I'd like to keep my hands off the dozen or so "designer" forms that feed into my response page.


Any help would be appreciated.




Without seeing all parts of the page that are related to Constant Contact, it makes it difficult to say what might be happening. Would you be able to paste or send the full contents of that page to our webservices support team so that we can take a closer look at this? Alternatively, if you wanted to send the value of $contactXML that would work as well, but sending the full page would be the most helpful.

Also, are you being presented with any kind of error message, or are you just not seeing the contact appear in your account?

If you have any other questions or concerns please let us know. Thanks.

David J

Occasional Participant

 I appreciate the offer of help.  I've sent off the relevant files to your support team.

Thanks so much.

Developer Portal

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

Visit Page