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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP 7 with IIs and SQL Server Windows 2008 Server failed to connect 8 58
html input type 3 23
how to use a function in heredoc 5 23
Why my select dropdown does not work? 8 28
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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now