Sometimes, we need to install a number of different versions of the PHP environment in the Windows Server, or a different php.ini configuration, such as the use of China's e-commerce network Ioncube system to encrypt the PHP program, To set the load
AuthName directive
Syntax:authname Auth-domain
Context:directory,. htaccess
Override:authconfig
Status:core
This directive sets the name of the authorization realm for a directory. This realm was given to the client so, the user knows which username
To prevent remote submission of forms to prevent hackers from illegally submitting data remotely to create security for our site, let me introduce you to prevent remote illegal submission of form instances in PHP.
Specific methods
I. How PHP
PHP's four function Exec,shell_exec,system,passthru can execute system instructions, which poses a threat to system security and can be turned off if not used.
The code is as follows
Copy Code
Vim/etc/php.ini
Introduce a function of generating random encryption in PHP, there is a need for friends to refer to, is a self-defined function is not the system comes with.
The code is as follows
Copy Code
function Encrypt_str ($TXT,
Write your own SQL injection detection function, you can effectively detect the user Post,get over the reference to filter, the need for a friend reference.
The code is as follows
Copy Code
Detection of/*sql
There are two types of anti-injection in PHP is SQL anti-injection, and another kind of process like many CMS all submitted variables, there is one can be directly configured php.ini, below I give you introduce.
1. Upload the safe.func.php to the
In PHP the simplest anti-theft chain method is the use of PHP $_server[\ ' http_referer\ ' function to operate, but this method is not reliable, we eventually need to use Apache,iis to operate, the following I share the introduction, the need for
Import OS
Import Sys
Import re
Import time
def listdir (dirs,liston= ' 0 '):
Flog = open (OS.GETCWD () + "/check_php Tutorial _shell.log", "A +")
If not Os.path.isdir (dirs):
Print "Directory%s is not exist"% (dirs)
Return
Lists =
Note: The following code needs to open the PHP Tutorial's GD library, modify the configuration of the Php.in file, and then cancel the semicolon before the commented out line: Extension=php_gd2.dll.
$width = 165;
$height = 120;
$image =
Traffic attack is a relatively primary site attack method, that is, constantly to brush the sample site, resulting in server processing or database load, resulting in a website can not be a normal method of attack means, the following I would like
This article collects a variety of
PHP Tutorial Filter HTML tag methodmethod, there is the use of PHP's own function to filter the HTML tag also has the use of user-defined function home plus expression to filter the HTM tag, OK, let's look at the
When we do the message system often want to do not appear to filter out the sensitive words, the following is a simple implementation, in fact, we can use the database to save the information, and then find out to make judgments.
The
Program code security is a programmer on the development of the various aspects of the quality of the embodiment, the following I will summarize their experience, there is a need to know a friend to refer to.
Baidu a bit. Only PHP scripts under the
In the development of the project with PHP a lot of time our modular development, then there may be a lot of security hidden, the following is my summary of some PHP project code security Summary, there is need to understand the students can refer
In a lot of time we php a lot of functions are not used, and the site has a great security problem, below we use a disable_functions switch option in php.ini to close some of the functions that do not need to use.
If prohibited, the following prompt
The article Simple analysis of the PHP file contained in the inlcude of a vulnerability analysis, the following hope for everyone a bit useful oh.
Basic file contains a vulnerability:
The code is as follows
Copy Code
This article introduced two to the PHP program self-encrypting method, our common method Base64_encode (Gzdeflate ($contents)) Such to encrypt, the second method rare has the need friend also may refer to.
Example 1
The code is as follows
We know that there are two ways to submit data on the Web, one is get, one is post, so many common SQL injections start with GET, and the injected statement must contain some SQL statements, because there is no SQL statement, then how to proceed,
Generally in the use of verification code when we have to achieve a partial refresh, this is inevitable, but also to improve the user experience, the following we look at a PHP verification code in the actual application of the use, there is a need
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