Home Backend Development PHP Tutorial get_magic_quotes_gpc()不能用怎么处理

get_magic_quotes_gpc()不能用怎么处理

Jun 13, 2016 pm 01:21 PM
deprecated get magic quotes

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 进行转义。

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to automate tasks using PowerShell How to automate tasks using PowerShell Feb 20, 2024 pm 01:51 PM

If you are an IT administrator or technology expert, you must be aware of the importance of automation. Especially for Windows users, Microsoft PowerShell is one of the best automation tools. Microsoft offers a variety of tools for your automation needs, without the need to install third-party applications. This guide will detail how to leverage PowerShell to automate tasks. What is a PowerShell script? If you have experience using PowerShell, you may have used commands to configure your operating system. A script is a collection of these commands in a .ps1 file. .ps1 files contain scripts executed by PowerShell, such as basic Get-Help

PHP Deprecated: Function split() is deprecated - Solution PHP Deprecated: Function split() is deprecated - Solution Aug 17, 2023 pm 05:36 PM

PHPDeprecated: Functionsplit()isdeprecated-Solution When developing with PHP, we may encounter the following warning message: PHPDeprecated: Functionsplit()isdeprecated. What this warning means is that the split() function has been deprecated and its use is no longer recommended in the latest PHP versions. This article will explore this problem and provide solutions

Learn about Magic Eden's Diamond Rewards: Value Earned and How to Get It Learn about Magic Eden's Diamond Rewards: Value Earned and How to Get It Jan 26, 2024 pm 05:57 PM

Previously, MagicEden, a mainstream NFT market on the SOL chain, launched the Launchpad function. Prior to this, PANews has introduced the operating status of MagicEden and provided analysis on optimizing operating methods and investment methods for NFT trading platforms and users. Recently, MagicEden launched new activities in terms of operations and introduced diamond rewards to motivate users to use its products. In this article, PANews will explain in detail how to get MagicEden’s diamond reward and evaluate whether this reward is worth earning. Are MagicEden Diamond Rewards worth earning? According to the official blog, the MagicEden platform now offers users more long-term benefits through Diamond Rewards empowerment.

How does java initiate an http request and call the post and get interfaces? How does java initiate an http request and call the post and get interfaces? May 16, 2023 pm 07:53 PM

1. Java calls post interface 1. Use URLConnection or HttpURLConnection that comes with java. There is no need to download other jar packages. Call URLConnection. If the interface response code is modified by the server, the return message cannot be received. It can only be received when the response code is correct. to return publicstaticStringsendPost(Stringurl,Stringparam){OutputStreamWriterout=null;BufferedReaderin=null;StringBuilderresult=newSt

The largest foldable external screen! Honor Magic V Flip unveiled The largest foldable external screen! Honor Magic V Flip unveiled Jun 14, 2024 am 11:21 AM

According to news on June 13, today evening, Honor’s first small folding screen Honor Magic VFlip officially debuted. Different from other small foldables, Honor MagicVFlip brings the industry's largest vertically folding magic external screen. Its screen size is 4.0 inches, using a four-curved and equal-depth design. The screen-to-body ratio has reached an unprecedented 85%. From then on, the external screen is no longer The "secondary screen" is the main screen both inside and outside. At the same time, Honor MagicVFlip external screen also has screen quality comparable to flagships, industry-leading Honor eye protection screen, and full-scenario smart interaction. It is reported that the Honor MagicVFlip external screen is a global low-power LTPO external screen that achieves an industry-leading local peak brightness of 2500nit.

Can magic system be upgraded to Hongmeng? Can magic system be upgraded to Hongmeng? Dec 22, 2022 pm 02:29 PM

The magic system cannot be upgraded to Hongmeng, because the magic system belongs to Honor phones, and Honor has been separated from Huawei and is no longer a subsidiary of Huawei. Therefore, Honor phones released after November 17, 2020 do not support upgrading to Hongmeng. systematic.

Example of Curl Get command Example of Curl Get command Mar 20, 2024 pm 06:56 PM

In Linux, URL or Curl client is a popular command line utility that allows you to transfer data over the network using various protocols such as HTTPS, HTTP, FTP, etc. It allows you to send and receive data using its get, post and request methods. Among them, you need to use the "get" method frequently. Therefore, it becomes crucial to learn various methods and various options that you can use to increase your productivity. "Performing a curl operation is as simple as entering a few simple commands. Although it seems simple, many users do not fully realize its potential. Therefore, this short guide provides some information on how to perform curl operations on Linux systems. Example using the "curlget" command." Curl

Zhao Ming warms up the Honor Magic V3: challenging the new height of foldable screen thinness and lightness Zhao Ming warms up the Honor Magic V3: challenging the new height of foldable screen thinness and lightness Jun 26, 2024 pm 03:51 PM

According to news on June 26, today, at the Shanghai MWC, Honor CEO Zhao Ming announced that Honor Magic V3 will be launched soon. This new product will challenge the new realm of foldable screens and thinness. Zhao Ming said that 12 months after the release of Honor MagicV2, no one has broken the record of thinness and lightness. Only Honor can surpass Honor. In July last year, the Honor MagicV2 had a folded thickness of only 9.9mm, an unfolded thickness of 4.7mm, and a weight of 231g. It broke the boundary between a candy bar machine and a folding screen, because when closed, it was almost as thick as a candy bar machine. and weight. It is reported that Honor MagicV2 uses the latest components such as screen, PU material, hinge, heat dissipation system, antenna, Type-C interface, fingerprint recognition, speakers, etc.

See all articles