php生成html静态页面完整实例_PHP教程
addform.php文件
代码如下 | 复制代码 |
|
add.php文件
代码如下 | 复制代码 |
require_once("mysql_inc.php"); //引用conn.php,连接数据库 $title=$_POST['title'];
//以下用SQL语句添加数据至表 news //以下为关键之处,把从表单获得的数据替换模板中的{title},{content}标记 $handle=fopen($path,"w"); //写入方式打开新闻路径
|
mysql_inc.php数据库连接文件
代码如下 | 复制代码 |
class mysql{
function __construct($host,$name,$pass,$database,$ut){ }
function query($sql, $type = '') { function show($message = '', $sql = '') { function affected_rows() { function result($query, $row) { function num_rows($query) { function num_fields($query) { function free_result($query) { function insert_id() { function fetch_row($query) { function version() { function close() {
function htmtocode($content){ $db=new mysql("localhost","root","","database","utf8");
|
推荐阅读
-
php技术生成静态页面的实现_PHP教程
-
PHP传值到不同页面的三种常见方式及php和html之间传值问题,phphtml_PHP教程
-
在PHP站点的页面上添加Facebook评论插件的实例教程_php实例
-
php过滤html标记属性类用法实例,标记实例_PHP教程
-
不需要mod_rewrite直接使用php实现伪静态化页面_PHP教程
-
php获取当前页面完整URL的代码_PHP教程
-
http://www.hunanzhibo.com/ php文章内容分页并生成相应的htm静态页面代码
-
利用PHP生成静态HTML文档的原理
-
php生成静态页面 文章列表问题
-
PHP生成静态HTML页面最简单方法示例,静态最简