一个个人网页自动化生成系统(1)

2016-01-29 13:34 3 1 收藏

一个个人网页自动化生成系统(1),一个个人网页自动化生成系统(1)

【 tulaoshi.com - PHP 】

当你希望用本系统创建你的个人主页之前,笔者相信你已经配置好了相关的阿帕奇服务器,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
<html
<head
<titleUntitled Document</title
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"
</head

 

<body bgcolor="#FFFFFF" background="image/b-graingr1.jpg"
<form method="post" action="shengcheng.php"
<table width="750" border="1" align="center"
<tr
<td width="53"标题:</td
<td colspan="3"
<input type="text" name="timu" size="50"
</td
</tr
<tr
<td width="53" height="28"作者:</td
<td width="154" height="28"
<input type="text" name="zuozhe" size="20"
</td
<td width="59" height="28"来源:</td
<td width="456" height="28"
<input type="text" name="laiyuan" size="30"
</td
</tr
<tr
<td width="53"正文:</td
<td colspan="3"
<textarea name="textt" cols="90" rows="20"</textarea
</td
</tr
<tr
<td width="53" </td
<td colspan="3"
<input type="submit" name="Submit" value="递 交"
<input type="reset" name="Submit2" value="复 位"
</td
</tr
</table
</form
</body
</html
单页生成,文件名:shengcheng.php
<html

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/php/)

 

<body background="image/b-graingr1.jpg"

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/php/)

<?php

$db = mysql_connect("localhost", "root");

mysql_select_db("study",$db);
// 把文章写入数据库
$t = date("Y-m-d h:i:s");
$sql = "INSERT INTO wenzhang (timu,zuozhe,laiyuan,textt,riqi)
VALUES ('$timu','$zuozhe','$laiyuan','$textt','$t')";
$result = mysql_query($sql);
// 把计数器加一
$fdd=fopen("count.txt","r");
$cdd=fread($fdd,5);
$cdd++;
fclose($fdd);
$fdd=fopen("count.txt","w");
fwrite($fdd,$cdd);
fclose($fdd);
// 文章生成
$muoban1 = fopen("muoban1.txt","r");
$muoban2 = fopen("muoban2.txt","r");
$muoban3 = fopen("muoban3.txt","r");
$qita = "<p<table width="75%" border="0" align="center"
<tr
<td class=p9
<div align="center"作者:<font color="#306800"$zuozhe</font ??来源:<font color="#306800"$laiyuan</font
??时间:<font color="#336600"$t</font </div
</td
</tr
</table</p";
$muoban4=fread($muoban1,1000);
$muoban5=fread($muoban2,1000);
$muoban6=fread($muoban3,1000);
fclose($muoban1);
fclose($muoban2);
fclose($muoban3);
$main="$muoban4 $timu $qita $muoban5 $textt $muoban6";
// 文章生成
$ttt=".html";
$n=$

来源:https://www.tulaoshi.com/n/20160129/1490668.html

延伸阅读
if not exists (select * from dbo.sysobjects where id = object_id(N'[IndexTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) create table IndexTable(Ex char(20), num integer) go create procedure SetIndex @Ex char(20),@result char(30) output,@Fmt integer as   declare @num...
标签: 电脑入门
    ソンソンソン 2011㏑ 莪们% 一定要″ ゜狠开心/ ゜狠幸福/ ソンソンソンソン --------------------------------------------- ヘノヘノヘノヘノ 一个人旳街角み 一个人旳等待み ヘノヘノヘノヘノ ╰つ〞 抱著回忆乱撞丶 コ コ コ コ ┅┅━━━━┅...
标签: PHP
  一个简单的自动发送邮件系统(三)     这里介绍php和mysql结合起来实用。如何从mysql数据库中提取数据。     好,我们已经成功的完成了我们的要求,很多的数据已经存在了数据库中,现在的问题是,如何查询这些数据,得到有用的结果呢? 在下面的程序中,我们将选择"apple"的...
标签: PHP
  这里介绍php和mysql结合起来实用。     基本上,可以说php是介于后台数据库和前台浏览器的一个中间层,在他们之间传递命令。这种方式大大提高了交互的可能性,可以方便使用在投票系统,其他动态用户输入和个性化网站中。     要想实现这种交互,首先必需实现和mysql数据库连接,可以使用这...
标签: 电脑入门
一、原因所在 您在使用工作并的时候,大概使用了窗口菜单中的新建命令来新建你的excel文件后保存,因此,就会出现这种情况。 也许是中毒了,office可能中毒了。 二、解决的办法 ①解决办法 找到office的安装目录,如C:Program FilesMicrosoft OfficeOFFICE11,里面有个文件夹,名称是:XLSTART 把这个文件夹和里面的所有内容全部删除,这...

经验教程

61

收藏

23
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部