本人初学php和html,问个弱偌的有关问题
本人初学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>

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

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

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

許多用戶在選擇智慧型手錶的時候都會選擇的華為的品牌,其中華為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

watch4pro和gt各自具有不使用的特點和適用場景,如果注重功能的全面性、高性能和時尚外觀,同時願意承擔較高的價格,那麼Watch 4 Pro可能更適合。如果對功能要求不高,更注重電池續航力和價格的合理性,那麼GT系列可能更適合。最終的選擇應根據個人需求、預算和喜好來決定,建議在購買前仔細考慮自己的需求,並參考各種產品的評測和比較,以做出更明智的選擇。

请问如何修改url某一参数的参数值呢?是要拆开了再拼回去吗?那么请问如何修改url某一参数的参数值呢?是要拆开了再拼回去吗?http://127.0.0.1/myo/newuser.php?mod=search&type=fastone比如现在我要修改mod=new要怎么做呢?------解决方案--------------------发送了请求

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