How to prevent html tags from being escaped when Baidu editor submits data

Source: Internet
Author: User
How to prevent html tags from being escaped when submitting data in Baidu editor is currently under development using ThinkPHP. after submitting text content to phpmyadmin using Baidu editor, the original data format tags have been escaped, the following information is displayed in the database: <p> & nbsp;
After the front-end calls the database, the browser resolves

The original format cannot be displayed.
Is there any better solution? How can I prevent html tags from being escaped when a form is submitted? Thank you!


Reply to discussion (solution)

$str = "<p>&nbsp;&nbsp;&nbsp;&nbsp;";$html = htmlspecialchars_decode($str);var_dump($html);

After the database is retrieved, it will be OK once it is transferred.

The server code of the Baidu editor sample is

// Get Data $ content = htmlspecialchars (stripslashes ($ _ POST ['myeditor']);

If you copy it, it will be escaped!
$ Content = stripslashes ($ _ POST ['myeditor']);
No Escape

Old Xu is very diligent, like!

I use

htmlspecialchars_decode

Onmouseenter



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.