上一次我們研究了guest.PHP文件.具體的問題還要求讀者朋友自己深入的去實踐,而且需要一些工具書來學習,如果您一點php的知識都沒有,筆者奉勸您就不要想下看了,筆者沒有太多的時間和篇幅去逐句探究一個php文件的用途和意義.好的,接下來我們來作edit.PHP這個文件.
-----------
//edit.PHP
<?
if ($Submit)
{
if ($SavePassWord=="on")
{setcookIE("TxtPassword","$TxtPassWord",time()+30*24*3600);}
else
{setcookIE("TxtPassWord");}
}
?>
<Html>
<style type=text/CSS>
Td {FONT-SIZE: 10pt;}
TEXTAREA
{
FONT-FAMILY: "宋體";
FONT-SIZE: 10pt;
}
</style>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/Html; charset=gb2312">
<title>修改留言</title>
<?
require("sys.PHP");
function readvalue($tags,$tage)
{
global $message,$long,$reply;
$StrStart=strlen(strstr($message,$tags))-strlen($tags);//去除標記後變量所在字串的起始位置.
$StrEnd=strlen(strstr($message,$tage));
$len=$StrStart-$StrEnd;
$StrStart=$long-$StrStart;//起始字符.
$StrString=substr($message,$StrStart,$len);
return $StrString;
}
function save($record)
{
global $TxtContent,$TxtEmail,$TxtHomepage,$TxtEmail,$TxtName,$TxtFrom,$TxtReply,$REMOTE_ADDR,$guestfile;
$content=file($guestfile,"r");
$space = " ";
$time = date(Y年m月d日H小時i分);
$ip=$REMOTE_ADDR;
$TxtReply=StripSlashes($TxtReply);
$TxtContent=StripSlashes($TxtContent);
$TxtContent=Htmlspecialchars($TxtContent);
$TxtContent=check_strlen_long($TxtContent);
$TxtContent=nl2br($TxtContent);
$Wcontent = "<tr><td><font color=#AB00E1>留言內容:</font><br><!--content>$TxtContent<!--endcontent> ";
$Wcontent=$Wcontent."<br><font color=#6633FF>留言人大名:</font><!--name>$TxtName<!--endname> ";
if ($TxtEmail !="")
{$Wcontent=$Wcontent."<br><font color=#9900CC>電子信箱</font><a href="mailto:$TxtEmail"><!--email>$TxtEmail<!--endemail></a>"."$space";}
if ($TxtHomepage !="http://")
{$Wcontent=$Wcontent."<font color=#9900CC>主頁:</font>$TxtHompage<a href="$TxtHomepage" target=new><!--homepage>$TxtHomepage<!--endhomepage></a>";}
$Wcontent=$Wcontent."<br><font color=#0000FF>