===================

先创建note.php

<html>
<head><title>PHP留言本</title></head>
<style type="text/css">
<!--
.{ font-family: "宋体"; font-size: 9pt;}
-->
</style>
<body bgcolor=#cccccc>
<center><font style=" color=color:#cccccc;font-size:12pt">php留言本</font>
<form method="POST" action="result.php">
<table border=1 width=555>
<tr>
 <td width=20%>您的大名:
 </td>
 <td width=50%><input type=text name=nickname style=width:100%>
 </td>
</tr>
<tr>
 <td width=20%>电子邮件:
 </td>
 <td width=50%><input type=text name=email style=width:100%>
 </td>
</tr>
<tr >
 <td width=20%>留言:<br><br><br>
 </td>
 <td width=80%> <textarea name=notes  cols="70" rows="5" ></textarea>
 </td>
</tr>
<tr>
 <td width=20%> </td>
 <td width=80% align=center><input type="submit" name=submit value="确定"><input type="reset" value="重写"><input name=clear type="submit" value="清除" >

 </td>
</tr></table>
</form></table>
<table border=1 width=555>
<tr><td>
<hr width=550><?
$f = fopen("note.txt","r");
$msg = fread($f,filesize("note.txt"));
fclose($f);
print "$msg";
?></td>
</tr>
</table>
</center>

<p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:<a href="mailto:dengfzj@126.com">业如</a><br>
主页:<a href="http://weibo.com/dengyr">微博</a></font>

</body>
</html>
然后创建

result.php

<html>
<head>
<style type="text/css">

</style>
<body bgcolor=#cccccc>

<table align=center border=0 width=555>  <tr>
<?php
//先判断是否清除
if($_POST["clear"]=="清除")
 {
 print "<td align=center><b><h1 ><font color=red>已清除!</font></h1></td><br><br>";
 $f=fopen("note.txt","w");
 fwrite($f,"");
 fclose($f);
 }
 else{
  if(($_POST["nickname"]&&$_POST["email"]&&$_POST["notes"])!=0)
  {
$t = date(Y年m月d日);
$note=str_replace("<","<",$_POST["notes"]);
$note=str_replace(">",">",$note);
$note=str_replace("
","<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$note);
$main="<font color=#FF6600>网上大名:</font><a href=mailto:".$_POST

["email"].">".$_POST["nickname"]."</a>(".$t.")<br><font color=#FF6600>

留言:</font>".$note." <br><hr width=550>"; 
$f=fopen("note.txt","a");
fwrite($f,$main);
fclose($f);
print "<td align=center><b><h1 ><font color=red>成功!</font></h1></td><br><br>";
print "$main";
print "<b><font font-size=9pt color=#FF99FF>谢谢您的留言!</font><br>";
}
  else{
  if ($_POST["nickname"]=="")
  print "<b><font font-size=9pt color=#00CC00>您的大名?</font><br>";
  if($_POST["email"]=="")
  print "<b><font font-size=9pt color=#00CC00>您电子邮件?</font><br>";
  if($_POST["notes"]=="")
  print "<b><font font-size=9pt color=#00CC00>您没有要说的吗?</font><br>";
  print "<td align=center><b><h1 ><font color=red>请检查以上各项!</font></h1></td><br><br>";
  }
 
   }
?>  </tr>
</table>
<p><br></p>
<p><br></p>
<center><a href="note.php">返回</a></center>
<p><br></p>
<p align=right><font style=" color=color:#cccccc;font-size:12pt">作者:

<a href="mailto:dengfzj@126.com">业如</a><br>
主页:<a href="http://weibo.com/dengyr">微博</a></font>

</body>
</html>

ok代码结束了

php留言板程序的更多相关文章

  1. css教程如何修改留言板程序

    error_reporting(0);$conn = new com("adodb.connection"); $conn->open("driver={micro ...

  2. [课程设计]Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案)

    Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统W ...

  3. 微信小程序实现简易留言板

    微信小程序现在很火,于是也就玩玩,做了一个简易的留言板,让大家看看,你们会说no picture you say a j8 a,好吧先上图. 样子就是的,功能一目了然,下面我们就贴实现的代码,首先是H ...

  4. flask实战-留言板-Web程序开发流程

    Web程序开发流程 在实际的开发中,一个Web程序的开发过程要设计多个角色,比如客户(提出需求).项目经理(决定需求的实现方式).开发者(实现需求)等,在这里我们假设自己是一个人全职开发.一般来说一个 ...

  5. Operator 示例:使用 Redis 部署 PHP 留言板应用程序

    「Kubernetes 官方示例:使用 Redis 部署 PHP 留言板应用程序」Operator 化. 源码仓库:https://github.com/jxlwqq/guestbook-operat ...

  6. jsp中运用application实现共享留言板功能

    jsp中application的知识点总结: 1.一个Web应用程序启动后,将会自动创建一个application对象,在整个应用程序的运行过程中只有这一个application对象,即所有访问该网站 ...

  7. JSP简易留言板

    写在前面 在上篇博文JSP内置对象中介绍JSP的9个内置对象的含义和常用方法,但都是比较理论的知识.今天为大家带来一个小应用,用application制作的简易留言板. 包括三个功能模块:留言提交.留 ...

  8. dede留言板BUG解决

    dede留言板刷新后空白BUG解决 DEDE留言板验证码留空或者不正确返回空白页面的解决方法 解决方法如下进入文件/plus/guestbook.php 找到代码ShowMsg("验证码不正 ...

  9. Servlet实践--留言板-v1

    功能介绍: 由三个jsp页面组成,在doGet中根据请求URL中的请求参数不同,跳转到不同的页面: 页面1:显示整个留言板列表 页面2:创建留言页面(包括用户.主题.内容和上传文件) 页面3:在查看单 ...

随机推荐

  1. 修改vim的颜色主题 及显示行号

    1.打开vim窗口,输入命令:color 或者colorscheme后回车查看当前颜色主题. 2. 输入:colorscheme <主题> 即可设置当前vim的颜色主题. sample: ...

  2. Vue小项目二手书商城:(一)准备工作、组件和路由

    本项目基于vue2.5.2,与低版本部分不同之处会在(五)参考资料中提出 完整程序:https://github.com/M-M-Monica/bukesi 实现内容: 资源准备(mock数据) 组件 ...

  3. CDH5.16.1集群新增节点

    如果是全新安装集群的话,可以参考<Ubuntu 16.04上搭建CDH5.16.1集群> 下面是集群新增节点步骤: 1.已经存在一个集群,有两个节点 192.168.100.19 hado ...

  4. dvi接口介绍

    Most graphics cards and motherboards feature a Digital Video Interface (DVI) connector for connectin ...

  5. 【原】git常见用法

    1.克隆 当前用户:git clone 192.165.53.15:/home/git/repo/Tegra/bsp/tx1_filesystem.git/ 非当前用户:git clone xxxxx ...

  6. HOMER | MEME | 转录因子的靶基因预测

    Finding Enriched Motifs in Genomic Regions (findMotifsGenome.pl) 在指定区域做motif enrichment,大大降低了假阳性. ME ...

  7. Python方法和属性的动态绑定 --面向对象

    需要了解的: __ slots __:属于魔术变量,即:系统实现某些特定功能的变量 __ slots __: 1.限定类实例能添加的属性 2.对当前类起作用,对继承的子类是不起作用的 实操: # co ...

  8. Click event doesn't work on dynamically generated elements

    I couldn't get live or delegate to work on a div in a lightbox (tinybox). I used setTimeout successf ...

  9. git reset 和 git revert 使用区别

    git reset 用于回退代码,但是git pull后会和远程分支保持一致,所以无法修改远程代码 git revert可以撤销代码,撤销后直接git push ,可以修改远程分支的代码

  10. SQL基本介绍

    SQL学习资料来源:http://www.w3school.com.cn/sql/index.asp SQL 是用于访问和处理数据库的标准的计算机语言. 什么是 SQL?SQL 指结构化查询语言SQL ...