The PHP Setcookie () function sends an HTTP cookie to the client. A cookie is a variable that is sent by the server to the browser. Cookies are usually small text files that the server embeds into the user's computer. This cookie is sent whenever
For beginners in PHP, when using the global keyword, you may find that a variable outside of a function within a function, in some cases, does not output the variable correctly (that is, the global variable is invalid). Let's look at a simple and
PHP Data typePHP supports eight original types (type).
4 Kinds of scalar types:String (String), Integer (integer), float (floating-point type, also double), Boolean (Boolean)Two types of composite:Array (array), Object (objects)Two special
The discovery today of the need to call subclasses in the parent class has never been used before and is also possible through practice. Examples are as follows:
The code is as follows
Copy Code
/*** Parent class calling
1 the global variable (external variable) before the description and then the static to form a global variable. The global variable itself is the static storage mode, static global variables are of course also static storage mode. The two are not
File action functions
1, Get filename: basename ();
2, get the file directory: DirName ();
3, PathInfo () Get the file information, return the result is an array, including path, file full name, file name and extension. For example:
Security is a very important aspect of programming. In any programming language, a number of functions or modules are provided to ensure the security of a program. In modern Web applications, it is often required to get input from users around the
For example, the following section of the login code:
The code is as follows
Copy Code
if ($l = @mysql_connect (' localhost ', ' root ', ' 123 ')) or Die (' Database connection failed ');mysql_select_db (' Test
3DES (or Triple DES) is the generic term for a triple-Data encryption Algorithm (Tdea,triple-Encryption-algorithm) block cipher. It is equivalent to applying three DES encryption algorithms to each block of data. The encryption key length of the
PHP programs often make mistakes summary
1. Does not turn to the Italian HTML entitiesA basic common sense: all untrusted inputs (especially the data submitted by the user from form) should be transferred before the output.echo $_get[' Usename
GZIP (Gnu-zip) is a compression technique. The page size can be turned into 30% or smaller after gzip compression. This way the user will feel very happy when browsing!To achieve the GZIP compression page requires a common browser and server support,
/*Session Brief descriptionSession is a server global variable, commonly used in the user login, shopping cart instances, used in some security requirements of the application of high.Session also has many advantages, such as easy to control, can be
Caching technology:Some information, such as the constant, but still variable information in the cache to speed up the display speed, this is very valuable, the so-called cache, popular understanding is a number of stored on the server side of the
The files that will be used
Num.txt//Cumulative number of visits
vist.php//Test Files
count.php//the core program for statistics access times, because it converts text into GIF images and prints it to the browser.
The code is as
Look at an example
The code is as follows
Copy Code
Class Cart { var $items; //Shopping cart Items //Put $num $a Rtnr into the car function Add_item ($ARTNR, $num) { $this->items[$artnr] + =
First, I would like to say that the articles on Baidu are all nonsense!There are some similarities and differences, but they do not explain the reasons. If they are not verified, they will be transferred to each other, wasting the audience time.The
What is Memcache?Memcache is a danga.com project that was first used for LiveJournal. Many people around the world use this cache project to build their own websites with high load, to share the pressure on database tutorials.It can cope with any
Function turntopage ($ url = "index. php", $ info = "page redirection...", $ second = 2 ){Print " n n page turning... n ";Print " n"; // open source code 111cn.netPrint " n ";Print " n n ";Print " n ";// 111cn.netPrint " n ";Print " n ";Print "
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