Recently, when you make a site, you need to generate static pages, but some of the generated static pages need to be dynamically obtained, how can not be generated every day it?
Finally on the Internet to check a bit, plus a to summarize, ah .... Finally realized. Sent, we study together. Oh...
Apply a: article count, get dynamic content
Count page: count.php
Copy CodeThe code is as follows:
Require_once './global.php ';
$DB->query ("Update". $tablepre. " Teacher set views=views+1 where id= ' ". $_get[' id ']." ' ");
$hello = $DB->fetch_one_array ("SELECT * from". $tablepre. " Teacher where id= ' ". $_get[' id ']." ' ");
$hcount = $hello [' views '];
?>
document.write (" ");
Add in static page mk.html
Remember: page path, generate static post-count file path will change.
Application Two: Get some dynamic information on this page, such as related articles
Similarly, links in static pages are still in this form
Copy CodeThe code is as follows:
The contents of the read.php are as follows:
Copy CodeThe code is as follows:
$cid =$_get[' CID '];
?>
document.write ("
"); document.write ("
"); document.write ("
| Order number | "); document.write ("
Grade Subjects | "); document.write ("
Time | "); document.write ("
"); $succquery = $DB->query ("SELECT * from". $tablepre. " Test where cid= ' $cid '); while ($SUCC = $DB->fetch_array ($succquery)) {?> document.write ("
"); document.write ("
| "); document.write ("
| "); document.write ("
| "); document.write ("
"); }?> document.write ("
");
document.write ("
");
There is another way:
Static side:
Copy CodeThe code is as follows:
Dynamic page:
Fill in any thing this is dynamic without document.write ()
http://www.bkjia.com/PHPjc/320379.html www.bkjia.com true http://www.bkjia.com/PHPjc/320379.html techarticle recently, when you make a site, you need to generate static pages, but some of the generated static pages need to be dynamically obtained, how can not be generated every day it? Finally went online to check a ...