|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对我一点用处没有啊,我知道该怎么学,但是我想如何才能更快的学,一周速成,啊不,24小时速成那种,皮皮你有没? 网站办理,文件名: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.cnzz.cn/NewsInfo/image/piao.gif" width="103" height="60"></p>
<p><img src="http://edu.cnzz.cn/NewsInfo/image/a.gif" width="100" height="35"></p>
<p><a href="muban.php"><img src="http://edu.cnzz.cn/NewsInfo/image/b.gif" width="100" height="35" border="0"></a></p>
<p><img src="http://edu.cnzz.cn/NewsInfo/image/c.gif" width="100" height="35"></p>
<p><img src="http://edu.cnzz.cn/NewsInfo/image/d.gif" width="100" height="35"></p>
<p><img src="http://edu.cnzz.cn/NewsInfo/image/e.gif" width="100" height="35"></p>
<p><img src="http://edu.cnzz.cn/NewsInfo/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.cnzz.cn/NewsInfo/image/add.gif" width="80" height="43" border="0"></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
如果你单纯是为了做网站赚钱,我想你还是别学php的好,去学ASP,JSP好了,毕竟它们有实力雄厚的公司去支持它们。 |
|