电脑爱好者,提供IT资讯信息及各类编程知识文章介绍,欢迎大家来本站学习电脑知识。 最近更新 | 联系我们 RSS订阅本站最新文章
电脑爱好者
站内搜索: 
当前位置:首页>> PHP>>一个web自动单页提交系统:

一个web自动单页提交系统

来源:www.cncfan.com | 2006-1-11 | (有1690人读过)

---摘自《奥索网》

提交form:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#006633">
<form method="POST" action="result.php">
<table width="720" border="0" align="center" bgcolor="#D2E7D1">
<tr>
<td>标题:
<input type=text name=nickname size="50">
</td>
</tr>
<tr>
<td>关键字:
<input type=text name=key size="50">
</td>
</tr>
<tr>
<td>
<div align="center">
<p>正文:


<textarea name=note cols="100" rows="20"></textarea>
</p>
</div>
</td>
</tr>

<tr>

<td width=80% align=center><input type="submit" value="确定"><input type="reset" value="重写">
</td>
</tr>

</table>
</form>
</body>
</html>
php处理程序:
<html>
<head>
<style type="text/css">
<!--
.{ font-family: "宋体"; font-size: 9pt;color:#000000}
-->
</style>
<body bgcolor=#cccccc>
<?
if ($nickname=="") {
print "<center><b><font color=#FF99FF>题目?</font>
";
}
else if ($key=="") {
print "<center><b><font color=#FF99FF>关键字?</font>
";
}
else if ($note=="") {
print "<center><b><font color=#FF99FF>内容?</font>
";
}else{
print "<p></p>";
$t = date(Y年m月d日);


$note = str_replace ( "<", "<", $note);
$note = str_replace ( ">", ">", $note);
$note = str_replace ( "n", "
", $note);

$main = "<html>
<head>
<title>Untitled Document</title>

<meta NAME="key" CONTENT=$key>
<meta NAME="name" CONTENT=$nickname>
</head>

<body bgcolor="#E1F0E9">
<table width="700" border="0" align="center" cellspacing="1" cellpadding="0" bgcolor="#006633">
<tr bgcolor="#E0F0E8">
<td height="40"><!-- 题目开始 -->$nickname<!-- 题目结束 --></td>
</tr>
<tr bgcolor="#E0F0E8" valign="top">
<td height="338"><!-- 正文开始 -->$note<!-- 正文结束 --></td>
</tr>
</table>
</body>
</html>
";



$fdd=fopen("count.txt","r");
$cdd=fread($fdd,5);
$cdd++;
fclose($fdd);
$fdd=fopen("count.txt","w");
fwrite($fdd,$cdd);
fclose($fdd);
$ttt=".html";
$n=$cdd.$ttt;
$f = fopen($n,"a");
fwrite($f,$main);
fclose($f);
print "<center><b><font color=#FF99FF>递交成功</font>
";


}
?>

<p>
</p>
<p>
</p>
<center><a href="input.php">返回</a></center>

</center>
</body>
</html>
PHP热门文章排行
网站赞助商
购买此位置

 

关于我们 | 网站地图 | 文档一览 | 友情链接| 联系我们

Copyright © 2003-2024 电脑爱好者 版权所有 备案号:鲁ICP备09059398号