PHP Simple login Log Out instance program (session)

About session Processing HTTP is a stateless protocol that shows that each request is handled independently of the previous or subsequent request, but in order to be able to adjust user-specific behavior and preferences, there is a practice of

PHP SQL anti-injection code

Illegal characters to filter$ArrFiltrate =array ("'", ";", "union");The URL to jump after an error is not filled in the default previous page$STRGOURL = "";Whether the value in the array existsfunction Funstringexist ($StrFiltrate, $ArrFiltrate)

PHP 301 redirect Jump Solution

First, the initial site, the general need to do without WWW domain name 301 to go with the WWW domain name; The code is as follows:Options +followsymlinksRewriteengine onRewritecond%{http_host} ^111cn.net [NC]Rewriterule ^ (. *) $

PHP to determine whether the exe file is normal

PHP to determine whether the exe file is normal Include "exeinfo.php";$pe = new Pe_viewer (' cmd.exe ');$pe->out ();?> , usually the virus will shell, after the shell of the program its section name is no longer common. Text,. Data,. Rdata, rsrc,

The difference between PHP two installation modes

Modular Installation: First move the Php4ts.dll to or from the Windows/system (Windows 9x/me) or Winnt/system32 (Windows nt/2000/xp) directory, overwriting the original file; Then modify the Apache configuration file httpd.conf: (assuming c:/php/is

Php directory creation and recursion infinite creation and deletion directory implementation code

The following is the program code: The code is as follows:Copy code Function mkdirs ($ dir){If (! Is_dir ($ dir )){If (! Mkdirs (dirname ($ dir ))){Return false;}If (! Mkdir ($ dir, 0777 )){Return false;}}Return true;}Mkdirs ('div/css/layout ');

Php ubb code parsing program

The code is as follows:Copy code /**+ ----------------------------------------------------------* UBB parsing+ ----------------------------------------------------------* @ Return string+ ----------------------------------------------------------*

Php regular expression to extract the email address from the string

[PHP] code The code is as follows:Copy code Function extract_emails ($ str ){// This regular expression extracts all emails from a string:$ Regexp = '/([a-z0-9 _.-]) + @ ([a-z0-9-]) +.) + ([a-z0-9] {2, 4}) +/I ';Preg_match_all ($ regexp, $ str, $

Php 2D array sorting code

The code is as follows:Copy code  $ Ar = array (0 => array ('a' => 5, 'B' => 3, 'C' => 3 ),1 => array ('a' => 5, 'B' => 2, 'C' => 1 ),2 => array ('a' => 1, 'B' => 1, 'C' => 2));$ A = array ();$ B = array ();  Foreach ($ ar as $ k => $ v ){$ A [$

PHP Currency Converter code

The code is as follows:Copy code  /** File: CurrencyConverter. php* Author: Simon Jarvis* Copyright: 2005 Simon Jarvis* Date: 10/12/05* Link: http://www.white-hat-web-design.co.uk/articles/php-currency-conversion.php ** This program is free

Classic php batch upload source code

The code is as follows:Copy code Html Untitled Document Uploade. Php file// Print_r ($ _ FILES ['spic ']);Header ('content-Type: text/html; charset = utf-8 ');// If (@ $ _ FILES ['spic ']) echo "ddddddddddd ";;Include('upFiles.css. Php ');

Php object-oriented programming

/* PHP object-oriented programming ** PHP5 ** Array and object: both belong to the PHP compound type (one variable can store multiple units) ** Objects are more powerful than arrays. They not only store multiple data, but also store functions in

Regular expressions for consecutive matching characters or numbers in php

Regular expression writing rules: "/rules must be written in the middle of two slashes /".(.: Decimal point) is used to match all characters except line breaks.(S: lower-case backslash (s) is used to match a single space character, including the tab

Generate the php code of the Xunlei address

Based on our needs, we wrote a php Tutorial to generate three Download software addresses for the Thunder Express tornado, which are probably implemented using base64 encryption programs. The code is as follows.Function zhuanhuan (){$ Urlodd =

Php url address email IP Address Verification

Php Tutorial url address email Address VerificationPreviously, we used regular expressions to verify email addresses, ip addresses, and url addresses. Now we use three functions: php filter_validate_url, filter_validate_email, and filter_validate_ip.

Php file Upload $ _ FILES move_uploaded_file

The first method is to use the index. php tutorial to access files. move_uploaded_files and files [] global variables will be used without any judgment.The first parameter is the input name of the form, and the second subscript can be "name", "type",

Php ignore_user_abort () to implement the task scheduler function

Ignore_user_abort () implements the php Tutorial file to run after the browser is closed. Let's take a look at this function usage.The ignore_user_abort () function sets whether the script execution is terminated when the client is disconnected.This

Php generates the random number mt_rand () rand () mt_srand () function.

Mt_rand () returns a random integer using the mersenne twister algorithm.SyntaxMt_rand (min, max) descriptionIf the optional parameters min and max are not provided, mt_rand () returns a pseudo-random number between 0 and rand_max. For example, if

Php detection character encoding code

Function utf8_gb2312 ($ str, $ default = 'gb2312 '){$ Str = preg_replace ("/[x01-x7f] +/", "", $ str );If (empty ($ str) return $ default;    $ Preg = array ("Gb2312" => "/^ ([xa1-xf7] [xa0-xfe]) + $/", // regular determine whether it is gb2312"UTF-8

Php curl_init function usage

Php curl_init function usageFirst, in php. ini in C \ windows, I opened the extension = php_curl.dll function, and then restarted apapche. The following is what I wrote to capture PHP information in Baidu:// Initialize curl$ Ch = curl_init () or die

Total Pages: 12780 1 .... 5658 5659 5660 5661 5662 .... 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.