论坛登陆 用户: 密码:
联系我们
设为首页
加入收藏
业界新闻 网络编程 程序开发 网页图象 聊天通讯 软件应用 网络安全 硬件学堂 教育频道 站长club
  ·推荐新闻
 
·美前任官员认为amd告倒英特
·搜索引擎关键字排行简介
·网站优化教程(一)
·msn近期遭受木马病毒骚扰 用
·用qq管理你的系统^_^ 
·测评中心金山毒霸联合发布7
·qq群聊实名 普通用户不受影
·雅虎思科联手推数字邮件签名
·这18条背下来没人敢和你忽悠
·自己动手,拯救丢失的硬盘数
  ·资料搜索
 
  ·相关文章
·php优化及高效提速问题小结
·回帖脱衣服的图片实现
·用php实现qq挂机
·phpbb2.0.15远程命令执行漏洞利
·从c/c++迁移到php——判断字符
·几点提高php序运行效率的方法
·output buffer (输出缓冲)函数
·include()与require()的对比
·php和asp对象的等价关系
·php, jscript 和 vbscript 函数
  ·热门新闻
首页>>网络编程>>php专区>>文章正文

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


 日期:2005-7-18 8:31:58     来源:易特网络技术   编辑:黑鹰  点击:
网站管理,文件名:guanli.php
<html>
<head>
<title>untitled document</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#ffffff" background="image/b-graingr2.jpg">
<table width="775" border="0">
<tr>
<td width="101" height="463" valign="top">
<p><img src="image/piao.gif" width="103" height="60"></p>
<p><img src="image/a.gif" width="100" height="35"></p>
<p><a href="muban.php"><img src="image/b.gif" width="100" height="35" border="0"></a></p>
<p><img src="image/c.gif" width="100" height="35"></p>
<p><img src="image/d.gif" width="100" height="35"></p>
<p><img src="image/e.gif" width="100" height="35"></p>
<p><img src="image/f.gif" width="100" height="35"></p>
</td>
<td width="663" height="463" valign="top">
<table width="95%" border="0" align="center" height="234">
<tr>
<td height="43">
<div align="center"><b><font color="#480000" size="6">页面管理</font></b></div>
</td>
</tr>
<tr valign="top">
<td height="267">


<?php
// 程序开始
$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 = "<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=$id.$ttt;
$f = fopen($n,"w");
fwrite($f,$main);
fclose($f);

echo "记录修改成功!<p>";


}

// 我们是否进入编辑修改状态
if ($id) {


// 我们是在编辑修改状态,因些选择一条记录

$sql = "select * from wenzhang where id=$id";

$result = mysql_query($sql);

$myrow = mysql_fetch_array($result);

$id = $myrow["id"];

$timu = $myrow["timu"];

$zuozhe = $myrow["zuozhe"];

$laiyuan = $myrow["laiyuan"];

$textt = $myrow["textt"];


// 显示id,供用户编辑修改


$fom1="<form method="post" action="$path_info">
<input type=hidden name="id" value="$id">


<table width="97%" border="0" align="center">
<tr>
<td width="53">标题:</td>
<td colspan="3">
<input type="text" name="timu" value=" $timu " size="50">
</td>
</tr>
<tr>
<td width="53" height="28">作者:</td>
<td width="154" height="28">
<input type="text" name="zuozhe" value=" $zuozhe " size="20">
</td>
<td width="59" height="28">来源:</td>
<td width="456" height="28">
<input type="text" name="laiyuan" value=" $laiyuan " size="20">
</td>
</tr>
<tr>
<td width="53">正文:</td>
<td colspan="3">
<textarea name="textt" cols="60" rows="10">$textt</textarea>
</td>
</tr>
<tr>
<td width="53"> </td>
<td colspan="3">
<input type="submit" name="submit" value="输入信息">
</td>
</tr>
</table>

</form>";
echo $fom1;
}
if (!$id) {


// 如果不是修改状态,则显示员工列表

$result = mysql_query("select * from wenzhang",$db);
printf("<ul>");
while ($myrow = mysql_fetch_array($result)) {

printf("<li><a href="%s.html">%s</a> n",
$myrow["id"], $myrow["timu"]);

printf("<a href="%s?id=%s">(修改)</a><br></li>", $path_info, $myrow["id"]);

}
printf("</ul>"); }
// 程序结束
?>

</td>
</tr>
<tr>
<td height="32">
<div align="right"><a href="input.php"><img src="image/add.gif" width="80" height="43" border="0"></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


上一篇:怎样在php中使用pdf文档功能
下一篇:一个个人网页自动化生成系统(2)
[发送给好友] [打印本页] [关闭窗口] [返回顶部转载请注明来源:http://www.iyit.net
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
责任编辑: 黑鹰 投稿作者: 易特网络
信息来源: 易特网络技术 录入时间: 2005-7-18 8:31:58
浏览次数: 投稿信箱: shtghy@163.com
设置首页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接
copyrights ©2004-2005 iyit.net all rights reserved. 网站合作、广告联系qq:147007642、466949678
易特网络技术 点击这里给我发消息