Recently, when creating a website, you need to generate static pages. However, some content in the generated static pages must be obtained dynamically ..Finally, I checked it online and added a summary .... Finally .. We will study it together .. Oh.
1. Use HTTP header informationThat is, use the php header function. The HEADER function in PHP is used to send control commands that should have been specified by the HTTP protocol to the browser through the WEB server, such as declaring the type of
The following describes its usage.For example:Copy codeThe Code is as follows:Function db_connect () // connect to the database{@ $ Db = mysql_connect ('localhost', 'root', 'test ');If (! $ Db)Throw new Exception ('failed to connect to the database!
Syntax: intIgnore_user_abort(Int [setting]);Return Value: integerFunction types: PHP system functionsDescription0-NORMAL (NORMAL) 1-ABORTED (abnormal exit) 2-TIMEOUT (TIMEOUT)Whether the PHP program continues to run after the function is configured
For example:Copy codeThe Code is as follows:$ USERID = "PHPer ";$ CookieTime = 0;Setcookie ("USERID", "$ USERID", time () + $ CookieTime, "/", "btcuxiao.com ");?>You will find that after the statement is executed, there is nothing in the Cookie. The
Define ('discuz _ root', substr (dirname (_ FILE _), 0,-7 ));This is a constant that defines the Forum installation root directory in discuz. Now let's analyze this simple but practical constant.In this article, we assume that the absolute path of
Echo preg_replace ("/(? ] *) (? ==>)/I "," # "," hello, click here to see hello, click here to see ");?>Regular :/(? ] *) (? ==> )/(? (? = Exp) match the position before expThis regular expression matches all non-">" characters before ">" after
XML parsing error: the xml Processing Instruction is not at the beginning of the object.Location: http: //.../public/xml/getRow: 2, column: 1: ^After careful check, it is found that the first behavior is empty. After searching for a long time, I did
Copy codeThe Code is as follows: Form name: password: Password confirmation: Gender: male female birthday: Email: occupation: Copy codeThe Code is as follows:// This program is used to receive form data from HTML
User-define-session-inc.php file code:Copy codeThe Code is as follows:Function mysession_open ($ save_path, $ session_name){@ Mysql_connect ("localhost", "root", "1981427") // You must connect to the database server before selecting a database.Or
Copy codeThe Code is as follows:// Multiple recipients$ To = 'aidan @ example.com '.', '; // note the comma$ To. = 'wez @ example.com ';// Subject$ Subject = 'birthday Reminders for August ';// Message$ Message =' Birthday Reminders for August Here
The details are as follows:1> if we know the start time, we need to add or subtract a time to get a result time, you can use the following code$ Time1 = '2017-10-1 12:30:30 ';Echo date ('Y-m-d H: I: s', strtotime ($ time1) + 30*60); // pay attention
File Upload codeView plaincopy to clipboardprint? Document Upload "/> File Upload list Document Upload "/> File Upload list Submit File CodeView plaincopy to clipboardprint? File Upload result If ($ _ POST ["submitfile"]! = ""){$ Path
Because XMLHttp decodes responstBody in UTF-8 encoding when processing returned responstText, if the data stream sent by the server is indeed UTF-8 encoding, then the text will be correctly displayed, however, if it is GBK or other encoding, the
Requirement: for example, develop an extension called heiyeluren. In the extension, enter a string in the heiyeluren_test () function, and the function returns: Your input string: xxxxx.Requirements: Understand C/C ++ programming and be familiar
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