Heck, it really is baffled, is it a bug? What to do with it

Source: Internet
Author: User
Heck,, really is baffled, is it a bug???
A paragraph of statements

$str = '
123
';

In the Pro Insert database when I print out, watch the source code is like this,

It's weird.

After the database is saved, the source code actually becomes

<pre> 123</pre>

And the database is the same, it is really scary ....

The bug??

------Solution--------------------
I can print out the SQL statements.
-----------------------
OK, look at this line of output in the browser source code.
 also not converted? 
------Solution--------------------

To see if the database data is healthy.
Abnormal check:
Echo $sql After insert was not manifested.

Normal:
is the manifested output.
------Solution--------------------
Escape character. The

uses the Addslashes function to insert data into the database and, when read, to revert to normal data using the Stripslashes function.
------Solution--------------------
TP Inbound is automatically processed
------solution--------------------
agreed upstairs to prevent SQL injection attacks. The last addition of that escape is useless. But it seems that the label "<" and ">" (. <pre>) replaced by "&\lt", "&\GT". This allows the code to be displayed correctly, without the code being executed
------solution--------------------
You use thinkphp, the thinkphp inserts all convert the label to
  • Related Article

    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.