1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />5 <title>Untitled Document</title>6 </Head>7 8 <Body>9 <Div>Ten <?PHP One $name = ""; A $tj 1= ""; - $FYTJ = ""; - if (!empty ($_get["name"])) the { - $name =$_get["name"]; - $FYTJ = "Name= $name"; - } + if (!empty ($_post["name"])) - { + $name =$_post["name"]; A $FYTJ = "Name= $name"; at } - $tj 1= "where areaname like '% $name% '"; - - - ?> - in </Div> - <Div> to <formAction= "5-12.php"Method= "POST"> + <Div>Please enter keywords:<inputtype= "text"value= "<?php echo $name;?>"name= "Name" /> - <inputtype= "Submit"value= "Query" /> the </Div> * </form> $ </Div>Panax Notoginseng <Tablewidth= "100%"cellpadding= "0"cellspacing= "0"Border= "1"> - <TR> the <TD>Code</TD><TD>Name</TD><TD>Parent Code</TD> + <?PHP A include ("database.class.php"); the include ("page.class.php"); + - $db =new Database (); $ $attrall = $db->query ("SELECT count (*) from Chinastates". $TJ 1); $ $total = $attrall [0][0]; - $page =new page ($total, $FYTJ, true); - $attr = $db->query ("SELECT * from Chinastates". $TJ 1. $page->limit); the foreach ($attr as $v) - {Wuyi echo "<tr><td>{$v [0]}</td><td>{$v [1]}</td><td>{$v [2]}</td></tr > "; the } - ?> Wu </TR> - </Table> About <Div> $ <?PHP - - echo $page->fpage (); - A ?> + </Div> the </Body> - </HTML>
PHP Paging Query Practice