PHP Web Protection SQL injection method configuration

For security reasons, you can open the Safe mode of the "php.ini" file, set "Safe_mode=on", and display the "display_erros" option for PHP execution error messages if it is turned on, it will return a lot of available information to the intruder, so

PHP Custom error handling function

Basic error handling: Using the Die () functionThe first example shows a simple script that opens a text file: The code is as follows Copy Code $file =fopen ("Welcome.txt", "R");?> If the file does not exist,

Security Summary of PHP project code

1: Basic Type,Include $module. '. PHP '; $module If you get it directly, then this is a very destructive bug, Linux makes you miserable, Windows let you dump production, such security will be directly discovered by people, and effectively blocked.

Encryption method for PHP source code

Instance 1 The code is as follows Copy Code Function Encode_file_contents ($filename) { $type =strtolower (STRRCHR ($filename, '. '), 1); if (' php ' = = $type && is_file ($filename) && is_writable ($filename)) {//If

A comprehensive PHP whole station anti-injection program

The general idea of SQL injection attack • Find SQL injection location;• Judge the background database type;• Determination of xp_cmdshell performance• Discovery Web Virtual directory• Upload asp,php,jsp Trojan;• Get admin privileges; ? PhpPHP

PHP High Security authentication Code generation program

The code is as follows Copy Code Public Function Captcha () {$font _dir = $_server ["Document_root"]. "Your_ttf_file.ttf"; Font Library$img _w = 58; Set Picture width$img _h = 20; Set Picture height$font _size = 11; Font size$angle _

PHP Verification Code Implementation Local refresh

/** Auth_code () is a validation code function* @access Public* @param int $width Indicates the length of the verification code and defaults to 80* @param int $height Indicates the height of the verification code, and defaults to 20* @param int $num

Some basic security handling techniques in PHP

There are built-in functions available in PHP for the escape of some common output destinations, including clients, database tutorials, and URLs.If you want to write your own algorithm, it is important to be foolproof. You need to find a reliable

PHP session Anti-URL attack method

Session tracking, you can easily avoid this situation: Session_Start ();$clean = Array ();$email _pattern = '/^[^@s]+@ ([-a-z0-9]+.) +[a-z]{2,}$/i ';if (Preg_match ($email _pattern, $_post[' email ')){$clean [' email '] = $_post[' email '];$user

PHP.ini prohibit phpinfo () do not run method

We just need to add in the PHP tutorial. ini Disable_functions =phpinfo PHP.ini introduces a feature disable_functions, which is useful and can be used to disable some functions. For example, in php.ini, add disable_functions = PassThru exec

PHP Prevents SQL injection code

PHP tutorial prevents SQL injection code */ function Inject_check ($sql _str) {//Prevent injection $check = eregi (' select|insert|update|delete| ' | /*|*|.. /|. /|union|into|load_file|outfile ', $sql _str); if ($check) { echo "Enter illegal

PHP anti-SQL injection filter Code

function Phps Tutorial Ql_show ($STR) {$str = Stripslashes ($STR);$str = Str_replace ("& #92;", "", $str);$str = Str_replace ("& #47;", "/", $STR);$str = Str_replace ("& #32;", "", $str);$str = Str_replace ("& #44;", ",", $str);return $str;}function

Website is attacked PHP prevent method

/** Website anti-IP attack code (ANTI-IP attack codes website) 2010-11-20,ver2.0*mydalle.com Anti-refresh mechanism*design by Www.111cn.net*/ Query prohibits IP$ip =$_server[' remote_addr '];$fileht = ". Htaccess2";if (!file_exists ($fileht))

Examples of prohibited PHP functions in PHP

The disabled methods are as follows:Open the/etc/php.ini file,Search to locate this line 1.disable_functions = Add the name of the function you want to disable, for example: The code is as follows Copy Code

PHP Form token prevent repeat submit principle

Example, session method   code is as follows copy code if ($_post) {     if ($_session["token"]!=$_post["token"]) {          die ("illegal submission!") ");    }else{         echo "secure submission!";    } } $

PHP uses OpenSSL to generate signature instance programs

Instance The code is as follows Copy Code /*** Generate signature content based on original text** @param string $data original content** @return String*/function sign ($strData){$filePath = ' test.pfx ';if (!file_exists (

PHP generates a UUID format string instance program

A UUID is a number generated on a single machine that guarantees that all machines in the same space-time are unique. Typically, the platform provides APIs for generating UUID. The UUID, based on the standard calculations developed by the Open

PHP Open_basedir Security and use of the detailed

The following is the original description in php.ini and the default configuration:; Open_basedir, if set, limits all file operations to the defined directory; and below. This directive makes most sense if used in a per-directory or; Per-virtualhost

Linux under the PHP Open PDO expansion module steps

Suppose the PHP directory is/usr/local/phpMySQL directory for/usr/local/mysql1. Enter the PHP source code package EXT/PDO Directory CD Ext/pdo 2. Execute/usr/local/php/bin/phpize[assume that the installation directory for PHP is/usr/local/php]

Linux system quickly build PHP extension Development Framework Step

1. Install Phpize (if it is compiled with PHP source code is free, itself) 2. Open the PHP source code, EXT has Ext_skel tools, use it can be convenient ./ext_skel--extname = Myext After you build the extended framework, you need to

Total Pages: 12780 1 .... 6884 6885 6886 6887 6888 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.