PHP code security and Xss,sql injection are very useful for the security of various sites, especially UGC (User generated Content) sites, forums and e-commerce sites, often the hardest hit of XSS and SQL injection. Here is a brief introduction to
UNIX Installation of PHP module, you need to recompile php,windows installation template, just php.ini in the configuration to open the corresponding DLL, for example, need to join the GB library support, you need to set the following:Extension_dir =
In the development of PHP system, the member is often an essential module, and password processing has to face the problem, PHP Mcrypt Encryption Library needs additional settings, many people are directly using MD5 () function encryption, this
SQL injection:
Under normal circumstances:
delete.php?id=3;$sql = ' Delete from news where id = '. $_get[' id '];
Malicious situation:
delete.php?id=3 or 1;$sql = ' Delete from news where id = 3 or 1 '; When-------do so, all records will be
At present I am using APC-3.1.9 stable, can download the latest version to Http://pecl.php.net/package/APC myself.
1, installation
Copy Code code as follows:
wget http://pecl.php.net/get/APC-3.1.9.tgz
Tar xzvf apc-3.1.9.tgz
CD
360 Publish the general PHP Protection Code, in fact, initially to help phpcms to protect the use of security, it appears to be able to join any of the loopholes in the site, take phpcmsv9 problems, the solution is as follows, other sites and so on!
First talk about parent and self:
Copy Code code as follows:
/*
* Created by Yinyiniao
*/
Class a{
function __construct () {
The method of constructing the echo "base Class A" ";
}
}
Class B extends a{
function __construct () {
Command mode, which is the mechanism that encapsulates a common operation.
If you are familiar with C or PHP, you may have encountered the command, which is equivalent to a callback (callback) in the program. Callbacks typically use a function
Heredoc technology, in regular PHP documents and technical books are not generally described in detail, but mentioned that this is a Perl-style string output technology. But now some of the Forum program, and some of the article system, are clever
Oh, the business needs to be sorted by a multidimensional array of elements, in PHP is also very easy to implement, a function called a callback function is done. Post the Code:
Copy Code code as follows:
$arr = Array (
' Index '
First, see if the message has been read
When you are sending a message, you may be wondering if the email has been read by the other person. Here's a very interesting piece of code that shows the actual date and time that the other IP address
This article illustrates the use of PHP to return JSON data functions and share them for your reference. The specific methods are as follows:
Json_encode () function usage:
echo json_encode (Array (' A ' => ' bbbb ', ' C ' => ' ddddd ');
Mb_convert_encoding This function is used to convert the encoding. The concept of coding the program has been not understood, but now seems to be a bit enlightened.But English does not usually have coding problems, only Chinese data will have this
This article describes the implementation of PHP to obtain and set the user Access page language classes, to share with you for your reference. The specific analysis is as follows:
The instance user Language Class gets/sets the page language that
What is the difference between PHP function method_exists () and is_callable ()? In the design process of PHP object-oriented object, we often need to call a certain method to belong to a certain class when the judgment, commonly used methods have
This article illustrates the bidirectional queue classes implemented by PHP and its usage, and has good reference value for the learning of PHP data structure and algorithm. Share to everyone for your reference. The specific analysis is as follows:
Are you looking for a job in PHP development and looking for some questions and answers about PHP? This article has shared some of the most frequently asked 11 PHP interview questions, as well as the corresponding regular answers, each company has
The example of this article describes the Phpmailer usage of the PHP mail sending class, and details its detailed operation steps. Share to everyone for your reference. The specific steps are as follows:
1. Install SendMail on the server
Recently, there are Buboyu asked php.ini which directory? or modify the php.ini after why not effective? Based on the above two questions, I think it is necessary to teach the friends who have just contacted PHP how to find the path directory of PHP
When writing the PHP template Engine tool class, a previously used regular substitution function of preg_replace (), plus the regular modifier/e, can perform powerful callback functions that implement template engine compilation (in fact, string
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