Home  >  Article  >  Backend Development  >  html - In PHP, the textarea input box automatically adds a backslash before ', how to solve it?

html - In PHP, the textarea input box automatically adds a backslash before ', how to solve it?

WBOY
WBOYOriginal
2016-10-22 00:14:231170browse

I made a PHP file with a textarea input box in it, but every time I copy and paste the code, a backslash is automatically added before " and '. How to crack this?

Reply content:

I made a PHP file with a textarea input box in it, but every time I copy and paste the code, a backslash is automatically added before " and '. How can I crack this?

Set magic_quotes_gpc in php.ini to Off, but it is generally recommended that when processing PHP, you still have to deal with single quotes, such as if(!magic_quotes_gpc()){ addslashes($str);} Prevent sql injection

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn