mysql-php Store HTML code to the database, how to read when the original style output?

Source: Internet
Author: User
Tags mysql text

The output is then printed with HTML,
Or there are other ways to store it!

Original style

Reply content:

The output is then printed with HTML,
Or there are other ways to store it!

Original style

You edit the content store with rich Text edit box, there must be automatically generated html tags AH! You must have come out of the reading area, but your browser access should be the format of your storage. If the browser is accessed html and the label is displayed, the program needs to be adjusted.

Ueditor stored in the database is the HTML format, when you output, directly to the browser to the line, the browser will parse, not the words of the AJAX request.

It should be your output when the output is Text/plain, the browser will get the content when the plain text output.

Add a header('Content-Type:text/html; charset=utf-8'); , so the browser will know that this is HTML.

What frame did you use? When the parameter is accepted, the HTML information is filtered, then the HTML information is not written into the library.

Store Rich text in MySQL text type, and put HTML code directly into the database.

  • 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.