PHP头条
热点:

php静态页面中显示动态内容


最近在做一个站点时,需要生成静态页面,但是生成的静态页面中有些内容是需要动态获取的,怎不能每天生成一下吧。。
最后上网查了一下,再加上个要总结,呵。。。。终于实现了。。发出来,大家一起研究。。呵。。。
应用一:文章计数,获取动态内容
计数页:count.php
代码如下:
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("");

静态页面mk.html中加入即可

相关文章

相关频道:

PHP之友评论

今天推荐