当前位置:网站首页>addslashes,stripslashes
addslashes,stripslashes
2022-06-21 15:59:00 【51CTO】
The official introduction :
(PHP 4, PHP 5)
addslashes — Use backslashes to reference strings
Return string , This string adds a backslash before some characters for the needs of database query statements, etc . These characters are single quotes (’)、 Double quotes (”)、 Backslash (\) And NUL(NULL character ).
PHP 5.4 Before PHP Instructions magic_quotes_gpc The default is on, Virtually all GET、POST and COOKIE Data are used by addslashes() 了 . Don't be right to have been magic_quotes_gpc Escaped strings use addslashes(), Because this will lead to double escape . In this case, you can use the function get_magic_quotes_gpc() To test .
// When magic_quotes_gpc=On When , function get_magic_quotes_gpc() It will return 1
// When magic_quotes_gpc=Off When , function get_magic_quotes_gpc() It will return 0
$str=$_POST["str"];// Read str The content of is assigned to $str Variable
if(get_magic_quotes_gpc())// If get_magic_quotes_gpc() It's open
{
$str=stripslashes($str);// Process strings
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
that , The problem is coming. , Now use php5.6,get_magic_quotes_gpc() by false, But , Direct access to $_POST Value , Or just escaped , Why is that ???
边栏推荐
- [evaluation with prizes] you can give feedback on my products. There is a prize!
- 最近学习的一些思考,附上答案,后续还需深入学习开发知识。
- MySQL transaction
- 站在数字化风口,工装企业如何'飞起来'
- 堪称神作!啃透这份JVM笔记,轻松搞定阿里30K面试!
- 目前哪个期货公司开户比较好?请问手续费低、交易又安全?
- Score-Based Generative Modeling through Stochastic Differential Equations
- GO语言-type关键字
- Elastic stack Best Practices Series: a filebeat memory leak analysis and tuning
- Torch utils. Data: analyze the whole process of data processing
猜你喜欢

鹅厂一面,有关 ThreadLocal 的一切

The rising sun chart effectively shows the hierarchy and ownership of data
![[North Asia data recovery] SQLSERVER database encrypted data recovery case sharing](/img/6d/7fc3c563fa1c503cbf09f345a4c042.jpg)
[North Asia data recovery] SQLSERVER database encrypted data recovery case sharing

Go language - pointer

站在数字化风口,工装企业如何'飞起来'

Best practice | how to use Tencent cloud micro build to develop enterprise portal applications from 0 to 1

"I, an idiot, have recruited a bunch of programmers who can only 'Google'

Gee Registration Guide

GO语言-接口

RichardSutton:经验是AI的终极数据,四个阶段通向真正AI的发展之路
随机推荐
Web网页自动化实战《1.利用py第三方库selenium完成艺龙网访问操作》
单一职责原则(SRP)
Soul app focuses on the social needs of generation Z and has won many awards for its outstanding performance in 2021
华为云发布桌面IDE-CodeArts
Write static multi data source code and do scheduled tasks to realize database data synchronization
Isn't this another go bug?
Review: effects of repetitive transcranial magnetic stimulation rTMS on resting state functional connectivity
The out of the box caching function of angular server-side rendering applications
Select article (039) - when the button is clicked, event What is target?
Goose factory, everything about ThreadLocal
Go language -type keyword
高级性能测试系列《4.性能测试的前提、性能测试工具、性能测试流程》
数据库连接不了不知道哪出问题了
Go language - structure
Manual instructions for Huawei AGC SMS service
【深度学习】被PyTorch打爆!谷歌抛弃TensorFlow,押宝JAX
Kubernetes deployment language
C multithreading
WSL 2 的安装过程(以及介绍)
Warning about UUIDs in MySQL master-slave replication