一个个人网页自动化生成系统_PHP教程
时间:2021-07-01 10:21:17
帮助过:30人阅读
当你希望用本系统创建你的个人主页之前,笔者相信你已经配置好了相关的阿帕奇服务器,MYSQL数据库,以及php。
接着启动你的mysql数据库,建立一个名为study的数据库,建立一个名为wenzhang的表。
在phpMyAdmin下建立如下字段:
id smallint(5) No 0 auto_increment
timu varchar(200) Yes
zuozhe varchar(18) Yes
laiyuan varchar(40) Yes
textt text Yes
riqi datetime Yes
单页递交。文件名:input.php
Untitled Document
单页生成,文件名:shengcheng.php
模板提交,文件名:muban.php
Untitled Document
模板生成,文件名:muobanshen.php
测试
$fdd=fopen("muoban1.txt","w");
fwrite($fdd,$muban1);
fclose($fdd);
$fdd=fopen("muoban2.txt","w");
fwrite($fdd,$muban2);
fclose($fdd);
$fdd=fopen("muoban3.txt","w");
fwrite($fdd,$muban3);
fclose($fdd);
echo "模板修改成功!
";
?>
治理文件
网站治理,文件名:guanli.php
Untitled Document







|
页面治理
|
// 程序开始
$db = mysql_connect("localhost", "root");
mysql_select_db("study",$db);
// 判定是不是修改文件
if ($submit) {
$sql = "UPDATE wenzhang SET timu='$timu',zuozhe='$zuozhe',
laiyuan='$laiyuan',textt='$textt' WHERE id=$id";
// 向数据库发出SQL命令
$result = mysql_query($sql);
// 文章生成
$t = date("Y-m-d h:i:s");
$muoban1 = fopen("muoban1.txt","r");
$muoban2 = fopen("muoban2.txt","r");
$muoban3 = fopen("muoban3.txt","r");
$qita = "
作者:$zuozhe ??来源:$laiyuan
??时间:$t
|
http://www.bkjia.com/PHPjc/631941.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631941.htmlTechArticle当你希望用本系统创建你的个人主页之前,笔者相信你已经配置好了相关的阿帕奇服务器,MYSQL数据库,以及php。 接着启动你的mysql数据库...
人气教程排行
|
|