PHP静态生成HTML页面(使用数据库生成)
有一个朋友问我怎么使用PHP生成HTML,我做了之后就把它写出来了。。。 CREATE TABLE IF NOT EXISTS `tdb_g` (`id` int(8) NOT NULL AUTO_INCREMENT,
`user` varchar(32) CHARACTER SET gbk NOT NULL,
`title` varchar(50) CHARACTER SET gbk NOT NULL,
`content` text CHARACTER SET gbk NOT NULL,
`gdatetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ;http://blog.运维网.com/attachment/201106/030424584.jpg
---------------------------------------------------------------------------
+++++++++++++++++++++++++++++++++++++++++
conn.php
$conn = @ mysql_connect("localhost", "root", "123456") or die("数据库链接错误");
mysql_select_db("guest", $conn);
mysql_query("set names 'GBK'");
+++++++++++++++++++++++++++++++++++++
index.php
http://blog.运维网.com/attachment/201106/030645721.jpg
-------------------------------------------------------------------
http://blog.运维网.com/attachment/201106/030606860.jpg文件结构图
____________________________
Index.html
标题:{title}
静态网页生成:{content}...{user}
http://blog.运维网.com/attachment/201106/030713486.jpg
________________________________
http://blog.运维网.com/attachment/201106/030724174.jpg
http://blog.运维网.com/attachment/201106/030734274.jpg
http://blog.运维网.com/attachment/201106/030748894.jpg
绿色字体为源码
页:
[1]