Not Adding Contact

Highlighted
New Member

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');


                                       etc.


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.


 

 

2 REPLIES 2
Highlighted
CTCT Employee

Re: Not Adding Contact

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

Highlighted
New Member

Not Adding Contact

 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

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured