1. Prevent jumping out of the web directory
First, modify httpd. conf. If you only allow Your PHP script program to operate in the web directory, you can also modify the httpd. conf file to limit the PHP operation path. For example, if your web
Note: The following functions do not use regular expressions.
The above are the three functions that match the first one to achieve the same purpose.
CopyCode The Code is as follows: function str_cut ($ STR, $ start, $ end) {// obtain the
Brief description :/*************************
Note:
Determines whether the passed variable contains invalid characters.
Such as $ _ post and $ _ Get
Function: Anti-Injection
**************************/
CopyCode The Code is as follows:
//
CopyCodeThe Code is as follows: $ A = 1; // start
$ B = 2; // end
$ C = $ B-$ A; // count the total number of images that can be generated
$ AB = $ in ['number'] = 4; // number of digits
$ A_c = $ in ['hdcount'] = 50; // how many images are
In the PHP document, we only mentioned that ECHO can use the following command to output multi-line strings (and the variables are automatically replaced ):
PHPCode Copy codeThe Code is as follows: Echo This uses the "Here document" syntax to
The following describes how to call a model function. The basic function of this function is to specify the name of a model (abstracted as a class), and then it will find the script of this class under the model directory and return it after
[Code] User Information summary ######################################## ################################ Connect to a database ######################################################## #####################$ Db = mysql_connect ("192.168.0.2", "root",
For example, an object is usually used to describe a date, number, or currency. Date, integer, or dollar class definitions are easy to use, fast, and easy to encapsulate, and easy to copy, compare, or even create.
On the surface, objects with
Assignment of variable transfer addresses
In PHP 3, values are always assigned to variables. PHP 4 provides another way to assign values to variables: assign values to input addresses. Assign values using the transfer address, that is, simply
CopyCodeThe Code is as follows: // Create an index pointing to the new COM Component
$ Word = new COM ("word. application") or die ("can't start word !");
// Display the version number of the word currently in use
// Echo "loading word, V. {$
CopyCode The Code is as follows: Date_default_timezone_set ('prc'); // Default Time Zone
Echo "Today:", date ("Y-m-d", time (), " ";
Echo "Today:", date ("Y-m-d", strtotime ("18 June 2008"), " ";
Echo "yesterday:", date ("Y-m-d", strtotime ("-1 day")
Syntax
String can be defined in three methods
''(Single quotes)" "(double quotes)
Escape sequences can be interpreted \
The biggest feature of double quotation marks is that the variable name will be replaced by the variable value
The
First, describe the requirements. According to the requirements of our system, we will query the desired data by combining the Department name, employee name, PC name, IP address, and other fields. For the sake of simplicity, we use a combination of
Class email {
// --- Set global variables
VaR $ mailto = ""; // recipient
VaR $ mailcc = ""; // CC
VaR $ mailbcc = ""; // Private CC
VaR $ mailfrom = ""; // sender
VaR $ mailsubject = ""; // topic
VaR $ mailtext = ""; // subject in text format
VaR $
The usage method is as follows, we can see the use of minixml, compared with the ActiveLink-PHP-XML-Package-0.4.0, more in line with the use of habits, but also more simple.
$ Xmldoc = new minixmldoc ();$ Xmlroot = & $ xmldoc-> getroot ();$
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