$.ajax request PHP Background to automatically add backslash escape character

Source: Internet
Author: User

$.ajax


PHP Backend return:



PHP code


Reply to discussion (solution)

Turn off PHP settings Magic quotes GPC
or run stripslashes on the results

Turn off PHP settings Magic quotes GPC
or run stripslashes on the results



Excuse me, my other colleague wrote the Ajax request exactly the same, how there is no escape character.

You are looking through the browser plugin response it?
Web direct output also with backslashes?

Because you opened the MAGIC_QUOTES_GPC switch.

if (GET_MAGIC_QUOTES_GPC ()) {  foreach ($_post as & $v) $v = Stripslashes ($v);}

You are looking through the browser plugin response it?
Web direct output also with backslashes?


Yes, the Web direct output is not. But the response inside represents the background to receive the time produced a slash

Because you opened the MAGIC_QUOTES_GPC switch.

if (GET_MAGIC_QUOTES_GPC ()) {  foreach ($_post as & $v) $v = Stripslashes ($v);}


But when someone passed the value, it didn't happen to me.

Everyone's PHP environment is the same?

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