php留言板程序
===================
先创建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> ",$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留言板程序的更多相关文章
- css教程如何修改留言板程序
error_reporting(0);$conn = new com("adodb.connection"); $conn->open("driver={micro ...
- [课程设计]Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案)
Scrum 3.7 多鱼点餐系统开发进度(留言板选择方案) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统W ...
- 微信小程序实现简易留言板
微信小程序现在很火,于是也就玩玩,做了一个简易的留言板,让大家看看,你们会说no picture you say a j8 a,好吧先上图. 样子就是的,功能一目了然,下面我们就贴实现的代码,首先是H ...
- flask实战-留言板-Web程序开发流程
Web程序开发流程 在实际的开发中,一个Web程序的开发过程要设计多个角色,比如客户(提出需求).项目经理(决定需求的实现方式).开发者(实现需求)等,在这里我们假设自己是一个人全职开发.一般来说一个 ...
- Operator 示例:使用 Redis 部署 PHP 留言板应用程序
「Kubernetes 官方示例:使用 Redis 部署 PHP 留言板应用程序」Operator 化. 源码仓库:https://github.com/jxlwqq/guestbook-operat ...
- jsp中运用application实现共享留言板功能
jsp中application的知识点总结: 1.一个Web应用程序启动后,将会自动创建一个application对象,在整个应用程序的运行过程中只有这一个application对象,即所有访问该网站 ...
- JSP简易留言板
写在前面 在上篇博文JSP内置对象中介绍JSP的9个内置对象的含义和常用方法,但都是比较理论的知识.今天为大家带来一个小应用,用application制作的简易留言板. 包括三个功能模块:留言提交.留 ...
- dede留言板BUG解决
dede留言板刷新后空白BUG解决 DEDE留言板验证码留空或者不正确返回空白页面的解决方法 解决方法如下进入文件/plus/guestbook.php 找到代码ShowMsg("验证码不正 ...
- Servlet实践--留言板-v1
功能介绍: 由三个jsp页面组成,在doGet中根据请求URL中的请求参数不同,跳转到不同的页面: 页面1:显示整个留言板列表 页面2:创建留言页面(包括用户.主题.内容和上传文件) 页面3:在查看单 ...
随机推荐
- 论文笔记:ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware
ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware 2019-03-19 16:13:18 Pape ...
- R-画图
1.par(mar=c(8,5.2,8,5.2),new=TRUE,cex=1.5,mfrow=c(2,2)) (参考:http://blog.sina.com.cn/s/blog_6caea8b ...
- 在多机器上远程执行JMeter
安装完jmeter之后直接执行%InstallDir%\apache-jmeter-3.2\bin\JMeter.bat可以启动UI界面,可以编辑或者执行TestPlan等,默认情况下,用例是在本机执 ...
- 用JSON.stringify处理循环引用对象
通常,我们会用JSON.stringify把Javascript对象序列化成JSON格式,这在大多数情况下是够用的.但是,当你要转换的对象里存在循环引用时,问题就来了. js对象循环引用导致内存泄漏 ...
- 使用 Chrome DevTools 调试 JavaScript
参考网址如下: http://www.css88.com/archives/8175 https://jingyan.baidu.com/article/67508eb423d2929ccb1ce45 ...
- Ant Design of React 框架使用总结1
一. 为什么要用UI 框架 统一了样式交互动画 . Ui框架会对样式,交互动画进行统一,保证了系统风格完整统一,不像拼凑起来的. 兼容性 ,不是去兼容IE 6 7 8那些低版本浏览器,而是对主流的标 ...
- selenium “could not be scrolled into view”
学习selenium对话框处理出现错误 a.py内容: from selenium import webdriver import timedriver = webdriver.Firefox()dr ...
- Qt中隐藏滚动条重新实现鼠标滚轮事件wheelEvent
delta()已经被弃用了,QT5中用的是angleDelta(),计算的时候取angleDelta().y()值. #重载方法wheelEvent(self,event),即滚轮事件方法 #---- ...
- Phpstorm-远程连接服务器实时编辑代码
一,配置远程服务器FTP 1.打开Phpstorm >>> 选择 2.选择 3.输入项目名称(此项目名称不会同步到服务器,只是在本地电脑上的项目名称) 4.将编辑器设置为实时自动同步 ...
- Python Django Web开发的5个优秀好习惯
https://blog.csdn.net/weixin_42134789/article/details/82381854