How PHP prevents SQL injection and development security[PHP] Function Inject_check ($sql _str) {$check =eregi (' select|insert|update|delete|\ ' |\/\*|\*|\.\.\/|\.\/|union| Into|load_file|outfile ', $sql _str); To filter if ($check) {echo '
MySQL can be connected via PHP and the web in two ways, a MySQL-related function via PHP, and an ODBC-related function via PHP.The relevant functions are as follows:MySQL functionMysql_affected_rows: Gets the number of columns affected by MySQL last
Urlencode (PHP4, PHP5) urlencode & mdash; encoded URL string description: stringurlencode (string $ str). This function is used to encode and encode a string.
Urlencode (PHP 4, PHP 5)
Urlencode-encode a URL string
Note:String urlencode (string $ str)
This article mainly introduces the json format data conversion program in php. We use the json_decode () and json_encode () functions to perform operations conveniently.
This article mainly introduces the json format data conversion program in php.
This article introduces a time-date conversion custom function in php, which can convert events in seconds to time formats such as year, month, day, and hour. FunctionSec2Time ($ time) {if (
This article introduces a time-date conversion custom
This article introduces a self-defined Fund conversion function, which can be converted into a bank format based on user input. for details, refer to the code below: function name: Exchan
This article introduces a self-defined Fund conversion
In php, the most common HTML tag can be replaced by the strip_tags function, which can be used to filter all html tags. next I will introduce you to this function.
In php, the most common HTML tag can be replaced by the strip_tags function, which
Today, when I wrote a recruitment system, I found that I directly submitted the content to the database in our original format, and there were no line breaks or spaces in the first line, for details, see the original
Today, when I wrote a
Before php52, if we want to verify whether the IP address is valid, we need to use regular expressions to verify that the IP address is valid. if it is valid, we need to call ping, but php5
Before php5.2, if we want to verify whether the IP address
In PHP, the character truncation function substr can only intercept all English letters without garbled characters. if there is a Chinese character in it, it cannot be intercepted. the following small series will introduce two compatible gbk and UTF-
Iconv is used for encoding and conversion. it works normally on windows Platform (win7 is used in the local environment). However, iconv always returns false (used in the Test environment ).
The iconv method is used for encoding and conversion. it
This article describes how to use strstr and strpos functions to query whether the specified string contains any expected characters. For more information, see. The strstr () function is used to obtain a specified
This article describes how to use
A simple file download example using the header () function. we briefly explained the excel operation tutorial. if you need it, you can refer to the code below: header (& quot; content-type: ap
A simple file download example using the header ()
The article details the differences between print_r, var_export, and var_dump in PHP and their usage in different php applications. it can be seen that both print_r and var_export are
This article describes in detail the differences between print_r,
There are many methods to obtain url parameters in php. The simplest method is to directly use the parse_url function, it is convenient to automatically parse url parameters and values and save the period to the corresponding array.
There are many
We only need to know the generation rules of the ID card. for example, the number of places from the specified position to the next is the date, and then we convert the date to the timestamp, and then perform the addition and subtraction operation
The eval () function is a function that everyone wants to disable in php. The eval () function is very dangerous. let's introduce eval () in php () function problems and solutions.
For a long time, it seems that the eval () function cannot be used
Boolin_array (mixed $ needle, array $ haystack [, bool $ strict]) searches for needle in haystack. If yes, TRUE is returned. otherwise, FALSE is returned. If the value of the third strict parameter is TRUE, the in_array () function will also check
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service