wysiwyg broken or txt area

6 posts by 2 authors in: Forums > CMS Builder
Last Post: July 24, 2013   (RSS)

Hi, 

In the record... in the WYSIWYG editor, when I click HTML and add a bunch of stuff, when i click "update" The code disappears, and doesnt save anything that i add.

I am only looking to add HTML code into this field, is there a way I can just avoid the WYSIWYG editor and just add a text box where I can enter in a chunk of code that will display on the website?

when i had it as a text area, it would show all of the HTML code on the website

By gregThomas - July 18, 2013

Could you paste the code you are using to display the field on your page? Are you using the htmlspecialchars function or the htmlencode encode function on the field? As these will cause the HTML characters to be displayed as opposed to being processed.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com

sorry for the delayed response...

<?php echo htmlencode($record['streamaddress']) ?>

that is what I am currently using and it is displaying the full HTML instead of actually rendering the HTML. I also tried...

<?php echo htmlspecialchars($record['streamaddress']) ?>

By gregThomas - July 24, 2013

Hi  shawnpatoka,

The issue is your using htmlencode/htmlspecialchars when you display the variable, and these functions convert special charters into there html entities, you can read more about the function here: http://php.net/manual/en/function.htmlspecialchars.php

To fix the issue you just need to remove the htmlencode/htmlspecialchars function:

<?php echo $record['streamaddress']; ?>

Cheers!

Greg

Greg Thomas







PHP Programmer - interactivetools.com