For security, we use the following function to filter some of the illegal characters passed over:
PHP Anti-injection function
The code is as follows
Copy Code
Illegal characters to filter$ArrFiltrate =array ("'", ";",
Anti-injection in PHP generally write a global file to filter special strings, this article summarizes a variety of PHP anti-injection function code, but also anti-SQL injection can be consulted.
For security, we used the following function to
PHP/** * Public Resources class * * **/classCommon {/** * General JSON return data * $code int returns an error code * $MSG string returns an error message * $data array returned by*/ Public Staticfunction Echoresult ($code =0, $msg ="', $data
Some of the following PHP functions are the most commonly used project development functions of our IT dynamics, which are also more common in more projects.
1. Processing function of the request interface
Copy CodeThe code is as follows:
/**
*
One common PHP code is the post request function of curl. it is mainly used for api development on various platforms to process request interfaces. if you have multiple platforms, data must be transmitted between them, this function is absolutely
Functions used to filter html code in php improve program security. The following is a function used to filter HTML code: Copy the code as follows: functionihtmlspecialchars ($ string) {if (is_array ($ string) {foreach ($ stringas $ key $ val) {$
One is the POST request function of curl, is mainly used for the development of Platform API, the processing function of the request interface, if you have multiple platforms, to pass data between each other, use this function absolutely useful:
Common functions extracted from phpcmsv9 *** return the strings or arrays processed by addslashes * @ param $ string or strings to be processed * @ returnmixed * functionnew_addslashes ($ string) {?? If (! Is_array ($ string) returnaddslashes ($
One is the post request function of curl, which is mainly used for api development on various platforms to process request interfaces. if you have multiple platforms and want to transmit data between them, this function is absolutely useful.
One is
Common functions extracted from Phpcms v9
/*** Returns a string or array that has been processed by addslashes* @param $string string or array to be processed* @return Mixed*/function New_addslashes ($string) {? ? if (!is_array ($string)) return
Some of the following PHP functions are the most commonly used project development functions of our IT power, these functions are used in more projects, and are more general.
1. Processing function of Request interface
Copy Code code as
Copy CodeThe code is as follows:
Class ExchangeRate
{
Private Const string _baseurl = "web address";
Public Const string CurrencyCode = "currency type to ' delimited";//currency type
Public Hashtable GetValues ()
{
Hashtable Htreturn = new
{Code...} is replaced here. After the signature is verified for the first time, an error $ this-& amp; gt; tokenSecret is reported directly. The signature error is always reported.
* Generate a signature * @ param $ data * @ param bool $
When your data contains some \"'This type of character is useful when it is written to the database and is not filtered out. It will automatically add \ before these characters, suchChina \ "Haha"China \ \ "Haha \"You can use
For php Security, use $ to GET the value without escaping the $ _ GET character. For more information, see
The code is as follows:
Function my_addslashes ($ string, $ force = 0 ){
! Defined ('Magic _ QUOTES_GPC ') & define ('Magic _ QUOTES_GPC'
Convert some of the predefined characters to HTML entities and precede predefined characters with backslashes, including single quotes, double quotes, backslashes, and NULL to secure the database
Convert some of the predefined characters to HTML
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.