FCKeditor value

Posted on 2007-03-27
Last Modified: 2012-05-05
After I type something in FCKeditor and save it in database. I output it in FCKeditor, it show a code format but not html. What can I do.

My code is showed as below

if ( isset( $_POST ) )
      {   $postArray = &$_POST ;                  // 4.1.0 or later, use $_POST
            foreach ( $postArray as $sForm => $value )
                  if ( get_magic_quotes_gpc() )
                        $postedValue = htmlspecialchars( stripslashes( $value ) ) ;
                        $postedValue = htmlspecialchars( $value ) ;

                  //$data .= $value;
                  $data .= $postedValue;

            $insert_sql_data = array('content' => $data);

$oFCKeditor->Value = $rs['content'] ;
Question by:huang_ck
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 18800163
I believe that anything typed the FCKeditor form is saved as text.  It is not parsed by the php engine unless you eval() the code after retrieving it from the database.

Accepted Solution

Kosta earned 500 total points
ID: 18807824
I think the problem is in the "htmlspecialchars". Why do you use it? Try just omit it:

f ( isset( $_POST ) )
      {   $postArray = &$_POST ;                  // 4.1.0 or later, use $_POST
            foreach ( $postArray as $sForm => $value )
                  if ( get_magic_quotes_gpc() )
                        $postedValue = stripslashes( $value )  ;
                  $data .= $postedValue;

            $insert_sql_data = array('content' => $data);

Expert Comment

ID: 21207263
Forced accept.

EE Admin

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question