本人初学php和html,问个弱偌的问题啊
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 首先,我们先确定,留言的几个过程:写留言,发送,查看.(搜索)等等.而且对于斑竹来说,管理留言本又是不可或缺的.这样我们就不妨定位于6个php文件,1个文本文件.6个php文件分别为:guest.php manage.php reply.php sys.php del.php edit.php,1个文本文件为:guest.txt 先来看看guest.php的内容,你当然可以直接将下面的内容放到您的php网页里,请尊重作者的劳动,谢谢. ---------------------- //guest.php: require("sys.php"); if ($B1) { if ($message=="" or $name=="") { $errorm="<font color="red">出错了!!!</font>姓名和留言内容必填"; } else { #写入数据 $space = " "; $time = date(Y年m月d日H小时i分); $ip=$REMOTE_ADDR; $name=encode($name); $homepage=encode($homepage); $from=encode($from); $email=encode($email); $message=StripSlashes($message); $message=htmlspecialchars($message); $message=check_strlen_long($message); $message=nl2br($message); $guestcontent = "<tr><td> <font color="#AB00E1">留言内容:</font><br><!--content>$message<!--endcontent> "; $guestcontent=$guestcontent."<br><font color=#6633FF>留言人大名:</font><!--name>$name<!--endname> "; if ($email !="") {$guestcontent=$guestcontent."<br><font color=#9900CC>电子信箱</font><a href=\"mailto:$email\"><!--email>$email<!--endemail></a>"."$space";} if ($homepage !="http://") {$guestcontent=$guestcontent."<font color=#9900CC>主页:</font>$hompage<a href=\"$homepage\"><!--homepage>$homepage<!--endhomepage></a>";} $guestcontent=$guestcontent."<br><font color=#0000FF>时间:$time 来自:<!--from>$from<!--endfrom> $ip</font>"; $guestcontent=ereg_replace(chr(10),"",$guestcontent); $guestcontent=$guestcontent."<hr size=1></td></tr>\n"; $fp=fopen($guestfile,"a"); fputs($fp,$guestcontent); fclose($fp); } } ?> <html> <head> <title>zihanonlinegbook</title> <style> <!-- A:link {text-decoration: none ; color:0000ff} A:visited {text-decoration: none; color:004080} A:active {text-decoration: none} A:hover {text-decoration: underline; color:ff0000} BODY {FONT-SIZE:10pt} TH {FONT-SIZE:10 pt} TD {FONT-SIZE: 10pt} TEXTAREA { FONT-FAMILY: "宋体"; FONT-SIZE: 10pt; } --> <div align="center"> include('head.htm');?> <table width="68%" border="1" cellpadding="3" cellspacing="0" bordercolor="#E3E3E3"> <form method="POST" action="guest.php"> if ($errorm) { echo "<tr>"; echo "<td colspan="3" height="32"> "; echo "$errorm"; echo "</td>"; echo "</tr>"; } ?> <tr> <td width="22%" bgcolor="#F0F0F0"><font color="#000000">姓名<font color="#FF0033">(必填)</font></font></td> <td colspan="2" width="78%" bgcolor="#F0F0F0"><font color="#00FF00"> <input type="text" name="name" size="40"> </font></td> </tr> <tr> <td width="22%" height="29">主页:</td> <td colspan="2" height="29" width="78%"> <input type="text" name="homepage" size="40" value="http://"> </td> </tr> <tr> <td width="22%" height="27" bgcolor="#F0F0F0">来自:</td> <td colspan="2" height="27" width="78%" bgcolor="#F0F0F0"> <input type="text" name="from" size="40"> </td> </tr> <tr> <td width="22%" height="20">Email:</td> <td colspan="2" height="20" width="78%"><font color="#00FF00"> <input type="text" name="email" size="40"> </font></td> </tr> <tr> <td colspan="3" valign="middle" align="left"> <div align="center"> <font color="#000000">请留言</font><font color="#FF0033">(必填)</font><font color="#00FF00"><br> <textarea rows="6" name="message" cols="55" wrap="VIRTUAL"></textarea> </font> </div> </td> </tr> <tr bgcolor="#F0F0F0"> <td colspan="3" height="24"> <div align="center"><font color="#00FF00"> <input type="submit" value="发 送" name="B1"> <input type="reset" value="重 写" name="B2"> </font></div> </td> </tr> </form> </table> <table width="68%" border="1" cellpadding="4" cellspacing="0" bordercolor="#E3E3E3"> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <form action="manage.php" method="post"> <tr> <td colspan="2"> <input type="hidden" name="dispflag" value="show"> 管理密码: <input type="passWord" name="password" size="8"> <input type="submit" value="确 定" name="submit"> </td> </tr> </form> </table> </td> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <form action="guest.php" method="post"> <tr> <td> 请输入关键字: <input type="text" name="keyword" size="10"> <input type="submit" name="search" value="搜索留言"> </td> </tr> </form> </table> </td> </tr> </table> function search($keyword) { global $content; $count=count($content); $subscript=0; $ArrSearch=array(); for ($i=0;$i$keyword",$content[$i]); $subscript++; } } return $ArrSearch; }//end function $one_page_line=15; $content = file($guestfile); if (isset($search) and isset($keyword) and $keyword!="") { $content=search($keyword); } $count =count($content); ?> <table width="68%" border="0"> <tr> <td> $int_page_count=$count;//总条数; $int_page_num=ceil($int_page_count/$one_page_line);//总页数; echo "<font color="#CC33FF">分页:"; for ($i=1;$i".$i." "; } echo "</font>"; if (isset($search) and isset($keyword) and $keyword!="") { echo "<br><center>"; echo "下面的留言中包含关键字<font color="red">$keyword</font>共<font color="red">".$count."</font>条</center>"; } ?> </td> <td><p align="right">共有<font color="red"><?echo "$count"?></font>条</p></td> </tr> </table> </div> <br> <table width="68%" border="0" align="center"> if ($page=="" or !isset($page)) {$page=1;} $text=""; $begin_line=$int_page_count-($page-1)*$one_page_line; if ($begin_line($begin_line-$one_page_line);$j--) { $text=$text."<tr><td align="right" colspan="2"> <a href="reply.php?job=reply&record=%22.%24j.%22">回复</a> <a href="edit.php?record=%22.%24j.%22">编辑</a> <a href="dele.php?record=%22.%24j.%22">删除</a> 第<font color="red">$j</font>条</td></tr>"; $text.=$content[$j-1]; //数组找下标从0开始. } echo "$text"; ?> </table> include('bottom.htm'); ?> </td></tr>

许多用户在选择智能手表的时候都会选择的华为的品牌,其中华为GT3pro和GT4都是非常热门的选择,不少用户都很好奇华为GT3pro和GT4有什么区别,下面就就给大家介绍一下二者。华为GT3pro和GT4有什么区别一、外观GT4:46mm和41mm,材质是玻璃表镜+不锈钢机身+高分纤维后壳。GT3pro:46.6mm和42.9mm,材质是蓝宝石玻璃表镜+钛金属机身/陶瓷机身+陶瓷后壳二、健康GT4:采用最新的华为Truseen5.5+算法,结果会更加的精准。GT3pro:多了ECG心电图和血管及安

为什么截图工具在Windows11上不起作用了解问题的根本原因有助于找到正确的解决方案。以下是截图工具可能无法正常工作的主要原因:对焦助手已打开:这可以防止截图工具打开。应用程序损坏:如果截图工具在启动时崩溃,则可能已损坏。过时的图形驱动程序:不兼容的驱动程序可能会干扰截图工具。来自其他应用程序的干扰:其他正在运行的应用程序可能与截图工具冲突。证书已过期:升级过程中的错误可能会导致此issu简单的解决方案这些适合大多数用户,不需要任何特殊的技术知识。1.更新窗口和Microsoft应用商店应用程

Pygame的Font文本和字体Pygame通过pygame.font模块来创建一个字体对象,从而实现绘制文本的目的。该模块的常用方法如下所示:名称说明pygame.font.init()初始化字体模块pygame.font.quit()取消初始化字体模块pygame.font.get_init()检查字体模块是否被初始化,返回一个布尔值。pygame.font.get_default_font()获得默认字体的文件名。返回系统中字体的文件名pygame.font.get_fonts()获取所有

第1部分:初始故障排除步骤检查苹果的系统状态:在深入研究复杂的解决方案之前,让我们从基础知识开始。问题可能不在于您的设备;苹果的服务器可能会关闭。访问Apple的系统状态页面,查看AppStore是否正常工作。如果有问题,您所能做的就是等待Apple修复它。检查您的互联网连接:确保您拥有稳定的互联网连接,因为“无法连接到AppStore”问题有时可归因于连接不良。尝试在Wi-Fi和移动数据之间切换或重置网络设置(“常规”>“重置”>“重置网络设置”>设置)。更新您的iOS版本:

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

watch4pro和gt各自具有不用的特点和适用场景,如果注重功能的全面性、高性能和时尚外观,同时愿意承担较高的价格,那么Watch 4 Pro可能更适合。如果对功能要求不高,更注重电池续航和价格的合理性,那么GT系列可能更适合。最终的选择应根据个人需求、预算和喜好来决定,建议在购买前仔细考虑自己的需求,并参考各种产品的评测和比较,以做出更明智的选择。

如何使用iPadOS17.4优化iPad电池寿命延长电池续航时间是移动设备体验的关键,iPad是一个很好的例子。如果您觉得iPad电池消耗速度过快,不用担心,在iPadOS17.4中有许多技巧和调整可以显著延长设备的运行时间。本深入指南的目标不仅仅是提供信息,而是改变您使用iPad的方式,增强您的整体电池管理,并确保您可以在无需充电的情况下更长时间地依赖您的设备。通过采用此处概述的做法,您朝着更高效、更谨慎地使用技术迈出了一步,这些技术是根据您的个人需求和使用模式量身定制的。识别主要的能量消耗者

每个人都在期待今天的Windows1123H2发布。事实上,Microsoft刚刚启动了对发布预览版的更新,这是正式发布阶段之前最接近的频道。被称为Build22631的Microsoft表示,他们正在推出新的更名聊天应用程序,电话链接和一起玩小部件,这些小部件在过去几个月中已在其他内部渠道中进行了测试。“这个新的更新将具有与Windows11版本22H2相同的服务分支和代码库,并将与所有新宣布的功能累积,包括Windows中的Copilot(预览版),”Microsoft承诺。雷德蒙德官员进一


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3汉化版
中文版,非常好用

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

Atom编辑器mac版下载
最流行的的开源编辑器

记事本++7.3.1
好用且免费的代码编辑器

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),