Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FCKeditor value

Posted on 2007-03-27
4
Medium Priority
?
1,478 Views
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 ) ) ;
                  else
                        $postedValue = htmlspecialchars( $value ) ;

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

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

.....
$oFCKeditor->Value = $rs['content'] ;
0
Comment
Question by:huang_ck
[X]
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
4 Comments
 
LVL 5

Expert Comment

by:Gitcho
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.

http://ca3.php.net/manual/en/function.eval.php
0
 
LVL 6

Accepted Solution

by:
Kosta earned 2000 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);
}
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21207263
Forced accept.

Computer101
EE Admin
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

618 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