设为首页
加入收藏
繁體中文
首 页客家风情客家影音山歌在线客家商城聊天室留言墙测字算命下载中心IT 技术客家论坛
您当前的位置:客家网 | 天南地北客家人 -> IT 技术-> PHP专区 -> 正文 退出登录 用户管理
栏目导航
· ASP · JSP
· 网络安全 · NET专区
· XML专区 · PHP专区
热门文章
· ASP+JavaScript的完整的..
· [图文] 防范非法用户的侵..
· ASP从数据库中获取文件..
· 网络管理中的常用命令
· [图文] 千年虫二世诞生业..
· [图文] FSO组件操作实例..
· 网络常见木马的手工清除..
· 利用ASP远程获取内容
· [图文] 简单购物车教程
· 一个ASP(VBScript)简..
· asp常用数据库连接方法..
· 网络常见木马的手工清除..
相关文章
· 一个非常精彩的日历程序..
· 一个个人网页自动化生成..
· 一个个人网页自动化生成..
· 正则表达式例子:在一个..
· 第三节 定义一个类 [3]
· 一个求最大值与最小值的..
· 创建一个ASP通用分页类(..
· 创建一个ASP通用分页类(..
· 一个拷贝整个文件夹(包括..
· 一个不太让人讨厌的自动..
· 断开的数据库连接的一个..
· 一个防止外部数据提交的..
· 一个取图片尺寸的类,支..
· 一个简单的SQL语句执行器..
· 不用询问关闭一个独立的..
一个个人网页自动化生成系统(3)
作者:time2  来源:奥索网  发布时间:2007-8-30 13:05:19  发布人:Admin

减小字体 增大字体

网站管理,文件名: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="http://edu.chinaz.com/Get/Program/Php/image/piao.gif" width="103" height="60"></p>
<p><img src="http://edu.chinaz.com/Get/Program/Php/image/a.gif" width="100" height="35"></p>
<p><a href="muban.php"><img src="http://edu.chinaz.com/Get/Program/Php/image/b.gif" width="100" height="35" border="0"></a></p>
<p><img src="http://edu.chinaz.com/Get/Program/Php/image/c.gif" width="100" height="35"></p>
<p><img src="http://edu.chinaz.com/Get/Program/Php/image/d.gif" width="100" height="35"></p>
<p><img src="http://edu.chinaz.com/Get/Program/Php/image/e.gif" width="100" height="35"></p>
<p><img src="http://edu.chinaz.com/Get/Program/Php/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="http://edu.chinaz.com/Get/Program/Php/image/add.gif" width="80" height="43" border="0"></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


[] [返回上一页] [打 印] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论…]
关于本站 - 网站合作 - 免责声明 - 友情连接 - 网站地图 - 客家论坛
本站部份内容来自网络 如无意中侵犯了您的权利 请及时与我们联系 我们会尽快处理
Copyright © 2006-2008 天南地北客家人
Email:yddlts@126.com  QQ:153161602
站长:大浪淘沙    QQ群:33754730
粤ICP备07019796号