function Outpege ($ps tutorial, $page){$ps Cumulative number of information $page the current page number $max the maximum number of lists $min the minimum value of the list$max = ($page >= 5)? $page +5:10;if ($max > $ps) $max = $ps;$min = ($page-5);
Look at this cache class first
The code is as follows
Copy Code
Class cache{/* class Name:cache Description:control to cache data, $cache _out_time are a array to save CAC He date is out. version:1.0 Author: Old
Header ("CONTENT-TYPE:TEXT/HTML;CHARSET=GBK")//output encoding to avoid Chinese garbled?>ajax Pagination Demo $page =isset ($_get[' page ')? Intval ($_get[' page '): 1; This is to get the value of page in Page=18, if there is no page, then the page
Learning Purpose: Learn to read data
Look at two functions first:1, mysql_querySend out a query string. Syntax: int mysql_query (string query, int [link_identifier]); return value: Integer
This function sends out the query string for MySQL to do
Learning Purpose: Learn the use of Session
The role of a lot of sessions, the most use is the site within the page variable transfer. At the beginning of the page we want to session_start ();Then you can use the session variable, for example, to
Purpose of study: matters needing attention Because I was first to learn ASP, so do PHP when you will find that many places need to adapt. 1, pay attention not to miss the semicolon2, pay attention not to miss the variable before the $3, use the
;;;;;;;;;;;;;;;;;
; Data handling;
;;;;;;;;;;;;;;;;;
Variables_order = "Egpcs"; This instruction describes the PHP record
; Get, POST, Cookie, environment and built-in the order of these variables.
; (G, P, C, E & S, usually referenced in the form
First, preliminary preparation Apache2 (WIN32) fully modular installation Perl,php,ssl
1, a installed WIN2000 server, note: If you have IIS installed on the machine, all the Web sites in IIS are stopped or the port first changed to something else.
2,
Use PHP's Ob_start (); Control your browser cache!
The output control function gives you a free rein in the outputs of the data in the script. It's very useful, especially for: when you want to output the file header after the data has been
Let's look at a piece of code first.
for ($i =10; $i >0; $i-)
{
echo $i;
Flush ();
Sleep (1);
}
?>
According to the PHP manual,
This function sends all the output of the program so far to the user's browser.
The above code, should be output
/**
* @name after the collection of processing
. PHP
* @date Sat Dec 02:07:45 CST 2007
* @copyright Mayong accounted for
(Myz)
* @author Mayong accounted for
(Myz)
* @link http://blog.111cn.net/mayongzhan/
*/
After the collection of documents
And
The Learning of PHP
Learning to use a php,php development speed should be good, the same project PHP code amount is estimated to be much less than using JSP.
But in the use of the process also found some problems, but also looked at some other
1: Why I can't get a variable
I post data name to another page on one page, why can't I get any value when I output $name?Register_global defaults to off in later versions of PHP4.2To obtain a variable submitted from another page:
Method One: Find
1, include ()Include (/path/to/filename)
The Include () statement contains a file at the location where it is invoked. An effect that contains a file with the same content as the data that copies the file at the location of the statement.
After a few days of sorting through a messy code, it became aware that PHP is not generally cheap for include processing: Other programming languages use the currently processed file as a benchmark when dealing with relative directories in include.
The simplest input is as follows: The code is as follows:Copy code {Dede: php}$ NumA = 1;$ NumB = 2;Echo $ numA + $ numB;{/Dede: php} From the preceding statement, we can see that the dede: php tag can be used in the same way in php. The above
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