Solved

FCKeditor value

Posted on 2007-03-27
4
1,455 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
4 Comments
 
LVL 5

Expert Comment

by:Gitcho
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
Forced accept.

Computer101
EE Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

743 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

17 Experts available now in Live!

Get 1:1 Help Now