Http://www.cnblogs.com/TankXiao/archive/2012/02/13/2342672.html
The development technology of today's web programs is truly a battle, ASP. NET, PHP, JSP, Perl, Ajax, and so on. Regardless of the future development of web technology, it is very
Generate verification Image
1. Image Generation class
Public class encryptimage {
Public String srand = "";
Public color getrandcolor (int fc, int BC) {// obtain a random color from a given rangeRandom random = new random ();If (FC> 255)Fc = 255;If (
File Upload is often used in PHP programs. Many problems need to be considered during file upload, such as the format, size, size, preview, scaling, cutting, and watermarking of the uploaded file, batch upload, etc,The following program mainly
The development technology of today's web programs is truly a battle, ASP. NET, PHP, JSP, Perl, Ajax, and so on. Regardless of the future development of web technology, it is very important to understand the basic protocols for communication between
The development technology of today's web programs is truly a battle, ASP. NET, PHP, JSP, Perl, Ajax, and so on. Regardless of the future development of web technology, it is very important to understand the basic protocols for communication between
The webpage cache is controlled by the cache-control in the HTTP message header. common values include private, no-cache, Max-age, must-revalidate, etc. The default value is private http://www.jb51.net/article/34017.htm.
The function of browser
Let's complete the previously disassembled functions first!1. Transparent layer (display and hide)The key is to set the following styles at the same time to make the mainstream browsers realistic and transparent.
Filter = 'Alpha (Opacity = 50
Header ()Is used to send raw HTTPHeaders. See the HTTP/1.1 specification for more information on HTTPHeaders.
Example 1:Copy codeThe Code is as follows: Header ("Location: http://www.jb51.net ";);Exit; // after each redirection, you must add "exit"
Write a verification code class in PHP and encapsulate it.
Class Name: validationcode. class. phpThe Code is as follows:
Copy codeThe Code is as follows: Class ValidationCode {
Private $ width;
Private $ height;
Private $ codeNum;
Private $ image; /
The function of browser review is divided into the following situations:(1) open a new windowIf the values are private, no-cache, and must-revalidate, the server will be accessed again when a new window is opened.If the max-age value is specified,
Common http header settings for php header Functions
This article mainly introduces the common http header settings of php header functions. This article provides code examples. The Code contains detailed comments. For more information, see
?
Php converts an image file to a binary output,
This example describes how php converts an image file to a binary output. Share it with you for your reference. The specific implementation method is as follows:
Header ("Content-type: image/jpeg"); $
First code: less codeUse regular expressions to obtain the real address of Baidu online storage files to Achieve straight-chain effect.
Save the following code as downbd. phpCopy codeThe Code is as follows: $ Canshu = $ _ SERVER ["QUERY_STRING"];If
Php implements 301 redirection jump instance code and 301 redirection
In php, the 301 redirection implementation method is very simple. We only need to simply use the header to send the 301 status code and then use the header to jump. The effect is
Note:
1. the compressed files are cached on the server, and the re-access reduces the re-compression time to reduce the CPU usage.
2. You can set the Client File Cache Time to reduce the number of re-requests by more than 85%.
3. Because the image
The basic syntax format of php is similar to that of C. If you have never learned C, you will be familiar with the format after several minutes to see how other people's source code is
Php draws a five-star red flag based on the GD Library. Php uses the GD library to draw a five-star red flag. the phpgd Library's five-star red flag example describes how php draws a five-star red flag based on the GD Library. Share it with you for
! IMG (img.ask.csdn.netupload201512301451467933_868908.png). The following figure shows that gd is usable after gd is enabled in the php. in configuration file. & Quot; this code has an error !! [Image description] (img. ask. csdn. netupload20 im
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.