The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

PHP Code Sample isn't encoding HTML chars properly

Highlighted
Occasional Contributor

PHP Code Sample isn't encoding HTML chars properly

I've copied the PHP code sample for creating a new campaign, and overall the process seems to work as intended.

 

However, I'm having trouble when copy/pasting my HTML template code into the editor box, and submitting it as an edited campaign - although it passes all of the values properly, when I look at the message in CC itself, all of the quote and double quote characters are preceeded by a slash - which then breaks the design.

 

How can I pass the HTML I've built into the new campaign, while preserving the characters?

2 REPLIES 2
Highlighted
Employee

Re: PHP Code Sample isn't encoding HTML chars properly

Hey Nancy,

 

If I understand you correctly, you would need to use html Entities.  Can you please post an example of your post so I can see what we are working with?

Ryan Davis
Quality Engineer
Highlighted
Occasional Contributor

Re: PHP Code Sample isn't encoding HTML chars properly

Ok, I had the html entity encoding in place, but I added stripslashes() to the XML output. That seems to have fixed the problem.

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured