PHP download Excel file,
1, in the process of downloading do not output any non-file information, such as Echo log information. Otherwise, the downloaded file cannot be opened, prompting for incorrect formatting or corrupted file.
2, the output of
Place the common call file (such as the Conn database link file) and filter the special strings for all get or post data for simple and efficient SQL injection filtering
Copy the Code code as follows:Function Inject_check ($sql _str) {Return eregi
Copy the Code code as follows:
/**
* Images class is a picture processing class
* @package Application.controllers
* @since 1.0
*/
Class Images
{
/**
* Zoom Picture
* @param $source Original picture
* @param $newfile New pictures
* @param $pre
Many times we need to concatenate a few strings to show that in PHP, the strings are connected using "dots", which is the period "." in English, using the following method:
Copy the Code code as follows:
Defining strings
$str 1 = "Hello world!";
Basic PHP Exercises--Image zoom:
Copy CodeThe code is as follows:
/**
* Image zoom.
*/
function Imagezoom ($filename, $w, $h) {
/* Arguments meaning */
/* $filename: The source of the name */
/* $w: You want get the image s width */
/* $h: You
For example, there are now and then. 3 pages. You want the user to start visiting the first page, then click Next to see "second page", and then before entering "third page", the user cannot
Back off. Let 1 and 2 be the same page. Leave a mark in
Copy the Code code as follows:
function Custom () {
}
Class custom{Public Function index () {
}}Print_r (get_define_position (' Custom '));
/*** /* @param string $name function name or class name* @return Array*/function Get_define_position
Copy the Code code as follows:
/*-----Save cookies-----*/
$url = ' www.xxx.com '; URL address
$post = "id=user&pwd=123456"; Post data
$ch = Curl_init ($url); Initialization
curl_setopt ($ch, curlopt_header,1); outputting header file information as a
Copy CodeThe code is as follows:
Require_once ("zend/loader.php");
Introduces the function class (INT) of the validator class and the verifier, and the custom interface class;
Zend_loader::loadclass (' zend_validate ');
Zend_loader::loadclass ('
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