get_magic_quotes_gpc()不能用怎么处理
Jun 13, 2016 pm 01:21 PM
get_magic_quotes_gpc()不能用怎么办
刚学php三天,希望高手们多多指教,谢谢哈
我用的编译软件是php5.4 。我在我的程序中使用了echo get_magic_quotes_gpc()函数来判断环境,从而决定输入数据库的信息是否需要设置转码。代码写好后在编译软件上没有显示错误,但是我打开浏览器却显示Deprecated: Function get_magic_quotes_gpc() is deprecated in.....。 于是我写了个测试用的语句echo get_magic_quotes_gpc();结果在浏览器上还是如此。
请问这种问题怎么解决,或者还有没有其它的方法来判断输入数据库的信息是否需要转码?
------解决方案--------------------
这个函数已经抛弃了,所以也就不需要再使用了.
可以使用addslashes()对提交的变量进行过滤.
------解决方案--------------------
到了php5.4 已经移除了这个功能。你直接用mysql_real_escape_string() 或者 addslashes 进行转义。

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to automate tasks using PowerShell

Learn about Magic Eden's Diamond Rewards: Value Earned and How to Get It

PHP Deprecated: Function split() is deprecated - Solution

The largest foldable external screen! Honor Magic V Flip unveiled

How does java initiate an http request and call the post and get interfaces?

Can magic system be upgraded to Hongmeng?

PHP Deprecated: Methods with the same name solution
