I've got the constant contact api working ok, but if I try to submit a duplicate email address, I get a The requested URL returned error: 409 which means duplicate, yeah, but this text is being inserted into my <body> with part of a wordpress page with it. Like I get that message and then a bunch of css and js head tags. Inserted into the page that I'm working with. I'm doing this from wordpress and I can see that the page being inserted is part of a wordpress page.
here's my body tag and the error msg
<body class="centered"> The requested URL returned error: 409
then there's all this
and that's my main div tag, and then the rest of my page. (if youre wondering why my links look like http://cosipad/ it's because i am deving locally with alias and modded hosts file)
I'd assume from the messaging that you're using a Wordpress site. Did you put together this module using any premade forms or libraries? It's hard to tell without seeing the code, but it looks like the connection is attempting to return the full HTTP response into your page as an echo, which has a body tag in it. The Wordpress script will probably then scramble to insert what it needs to be in there. Turning off the echo of the HTTP response would probably disable this.
It's a little difficult to do a full troubleshoot on this without the code, however. If you would like, you can send your modifications as attachments to firstname.lastname@example.org, so we can review your code and see if there's anything we can turn up from there.
Howdy, yes on the wordpress. No on premade scripts. Unsure what you mean about "Turning off the echo of the HTTP response" Unless you mean that i am explicitly echoing that which i am not.
I found the trigger, if not the actual cause, and have fixed the problem
Not sure of the exact cause, but the trigger is sending an empty var to
If that method gets a real email address, things are normal.
so, I had a bug in my code which was giving subscriberExists() an empty variable, this is what causes the page info to be inserted into the actual page. If i give it an email address, it works fine.
I believe that this is caused as a side effect of how error handling is done with this library. All errors from cURL are caught and echoed back to the page. I'm betting when this is combined with Wordpress, the result is your main page being shown with just the echoed error message as the content from Constant Contact. You'd just need to change the way errors are handled in the exception handling portion of the library to adjust to how you want to handle errors instead.