Ò»¸öphp×÷µÄÎı¾ÁôÑÔ±¾µÄÀý×Ó(¶þ)

5年以前  |  阅读数:230 次  |  编程语言:PHP 

ÉÏÒ»´ÎÎÒÃÇÑо¿ÁËguest.phpÎļþ.¾ßÌaµÄÎÊÌa»¹ÒªÇo¶ÁÕßÅoÓÑ×Ô¼ºÉiÈeµÄȥʵ¼u,¶øÇÒÐeÒªÒ»Ð(C)¹¤¾ßÊeÀ´Ñ§Ï°,Èç¹uÄuÒ»µaphpµÄ֪ʶ¶¼Ã»ÓÐ,±ÊÕßiÈ°Äu¾Í²»ÒªÏeÏ¿´ÁË,±ÊÕßûÓÐÌ«¶aµÄʱ¼aºÍƪuÈ¥Öð¾a̽¾¿Ò»¸ophpÎļþµÄÓÃ;ºÍÒaÒa.ºÃµÄ,½ÓÏÂÀ´ÎÒÃÇÀ´×÷edit.phpÕa¸oÎļþ.
-----------
//edit.php

<?
if ($Submit)
{
if ($SavePassword=="on")
{setcookie("TxtPassword","$TxtPassword",time()+30243600);}
else
{setcookie("TxtPassword");}
}
?>

ÐÞ¸ÄÁoÑÔ function save($record)
{
global $TxtContent,$TxtEmail,$TxtHomepage,$TxtEmail,$TxtName,$TxtFrom,$TxtReply,$REMOTE_ADDR,$guestfile;
$content=file($guestfile,"r");
$space = " ";
$time = date(YÄemÔÂdÈÕHСʱi*Ö);
$ip=$REMOTE_ADDR;
$TxtReply=StripSlashes($TxtReply);
$TxtContent=StripSlashes($TxtContent);
$TxtContent=htmlspecialchars($TxtContent);
$TxtContent=check_strlen_long($TxtContent);
$TxtContent=nl2br($TxtContent);
$Wcontent = "ÁoÑÔÄÚÈÝ:
<!--content>$TxtContent<!--endcontent> ";
$Wcontent=$Wcontent."
ÁoÑÔÈË´oÃu:<!--name>$TxtName<!--endname> ";
if ($TxtEmail !="")
{$Wcontent=$Wcontent."
µç×ÓÐÅÏa<!--email>$TxtEmail<!--endemail>"."$space";}
if ($TxtHomepage !="http://")
{$Wcontent=$Wcontent."Ö÷Ò³:$TxtHompage<!--homepage>$TxtHomepage<!--endhomepage>";}
$Wcontent=$Wcontent."
ʱ¼a:$time À´×Ô:<!--from>$TxtFrom<!--endfrom> ".$ip."";
$Wcontent=ereg_replace(chr(10),"",$Wcontent);
$Wcontent=$Wcontent."
";
$TxtReply=ereg_replace(chr(10),"",$TxtReply);
$WContent=$Wcontent.$TxtReply."n";
$count=count($content);
$fp=fopen($guestfile,"w");
for ($i=0;$i<$count;$i++)
{
if ($i==$record-1)
{$content[$i]=$WContent;}
fputs($fp,$content[$i]);
}
fclose($fp);
}

$content=file($guestfile,"r");
$message=$content[$record-1];
$long=strlen($message);
$txtcontent=readvalue('<!--content>','<!--endcontent>');
$txtname=readvalue('<!--name>','<!--endname>');
$txtfrom=readvalue('<!--from>','<!--endfrom>');
$txtemail=readvalue('<!--email>','<!--endemail>');
$txthomepage=readvalue('<!--homepage>','<!--endhomepage>');
$txtcontent=strip_tags($txtcontent);
$tags="<!--reply>";
$txtreply=strstr($message,$tags);
$txtreply=ereg_replace(""",""",$txtreply);
if ($Submit)
{
if ($TxtPassword==$managepwd)
{
if ($TxtName!="" and $TxtContent!="")
{
save($record);
echo "";
exit;
}else {$errorm="ÁoÑÔÈËÐÕÃuºÍÄÚÈݱØÌi!!";}
}
else {$errorm="ÃÜÂe´iÎo,Ö»ÓйÜÀiÔ±ÓÐȨÐÞ¸Ä!!";}
}
?>

"; echo""; echo""; } ?>
"; echo"³o´iÁË,$errorm"; echo"
ÁoÑÔ´oÃu > ¡¡ À´×Ô >
Ö÷Ò³µØÖ* > Email >
ÁoÑÔÄÚÈÝ
ÐÞ¸ÄÃÜÂe > ÊÇ*ñ±£´aeÃÜÂe >
      <input type="submit" value="ÎÒÒªÐÞ¸ÄÁË" name="Submit">   
    </td>   
  </tr>   
  <? echo "$txtreply"?>   
   <input type=hidden name=TxtReply value="<? echo "$txtreply" ?>">   
  </form>   
</table>   
\---------- ¸Ã×¢Ã÷µÄµØ*½ÎÒÒÑ×÷ÁËÚ¹ÊÍ.php¿ÉÒÔǶÈehtml´uÂeÖÐ,ÕaÑuдÆð´uÂeºÜa«Òa. ´ýÐø...
 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例