Home Backend Development PHP Tutorial 'Please do not access the superglobal $_GET array directly'

'Please do not access the superglobal $_GET array directly'

Jul 29, 2016 am 09:13 AM
get name netbeans quot

I downloaded an IDE called NetBeans to develop a PHP program. When I entered the commonly used $name = $_GET['name'];, I received a warning: Please do not directly access the super-global $_GET array. Please change it. Use some filtering functions (such as filter_input(), conditions with is_*() functions, etc.) . Only then did I realize that my usual approach was not standardized. In fact, the warning can be eliminated by changing it to the following form:

<code>$name = "";
if(is_string($_GET['name'])){
	$name = strval($_GET['name']);
}</code>
Copy after login

Since the programming language I use is relatively complicated, sometimes I don’t download a special IDE. For windows, I usually just use Hidemaru and Editplus. type editor; while Mac is more lazy and uses Xcode directly. But now I feel that NetBeans is really good, and it helped me realize this irregular writing method. It seems that in the future we should follow the saying "If a worker wants to do his job well, he must first sharpen his tools."

The above introduces "Please do not directly access the super-global $_GET array", including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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 Article Tags

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

How to automate tasks using PowerShell

Java Error: NetBeans Error, How to Solve and Avoid Java Error: NetBeans Error, How to Solve and Avoid Jun 25, 2023 pm 06:50 PM

Java Error: NetBeans Error, How to Solve and Avoid

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

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

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决

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

Example of Curl Get command

How to change Ubuntu's apt-get update source? How to change Ubuntu's apt-get update source? Jan 05, 2024 pm 03:40 PM

How to change Ubuntu's apt-get update source?

In-depth analysis of the similarities and differences between the get method and post method in jQuery In-depth analysis of the similarities and differences between the get method and post method in jQuery Feb 24, 2024 pm 12:15 PM

In-depth analysis of the similarities and differences between the get method and post method in jQuery

The difference between get and post The difference between get and post Sep 13, 2023 am 10:23 AM

The difference between get and post

See all articles