欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > php >内容正文

php

php text留言本,PHP+TEXT留言本(五)

发布时间:2023/12/15 php 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 php text留言本,PHP+TEXT留言本(五) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

现在我们来讲一下reply.php的代码:

---------------------------------

//reply.php

function check_strlen_long($txt)

{

$len=strlen($txt);

$count=0;

for ($i=0;$i{

if (ord($txt[$i])<128)

{ $count=$count+1;}

if (ord($txt[$i])==10 or ord($txt[$i])==32)

{$count=0;}

if ($count>=60)

{

$txt[$i]="n";

$count=0;

}

}

return $txt;

}

function encode ($txt)

{

$txt=strip_tags($txt);

$txt=htmlspecialchars($txt);

$message=StripSlashes($txt);

return $message;

}

$content=file("guest.txt");

$disptext=$content[$record-1];

if ($job=="addreply" and $replyname!="" and $replycontent!="")

{

$content=file("guest.txt");

$count=count($content);

$time = date(Y年m月d日H小时i分);

$ip=$REMOTE_ADDR;

$replycontent=StripSlashes($replycontent);

$replyname=encode($replyname);

$replycontent=htmlspecialchars($replycontent);

$replycontent=check_strlen_long($replycontent);

$replycontent=nl2br($replycontent);

$replycontent=ereg_replace(chr(10),"",$replycontent);

$content[$record-1]=substr($content[$record-1],0,strlen($content[$i])-1); $content[$record-1]=$content[$record-1]."

include(head.htm);?>

if ($Submit)

{

if ($replyname=="" or $replycontent=="")

{

echo"

";

echo"";

echo "出错了回复人姓名和回复内容必填-www.devdao.com!";

echo"";

echo"";

}

}

?>

echo $disptext ?>

回复大名

回复内容

>

总结

以上是生活随笔为你收集整理的php text留言本,PHP+TEXT留言本(五)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。