[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

FCKeditor value

Posted on 2007-03-27
4
Medium Priority
?
1,482 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
3 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
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…
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 …
Suggested Courses
Course of the Month19 days, 21 hours left to enroll

872 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