Jump to navigation

You are currently browsing all posts tagged with '验证码'

supesite 发文时加入验证码,防自动发贴机,防自动发贴机器人

  • Posted on July 15, 2010 at 10:54 am

在supesite里面,发布博客文章的时候,
URL为:spacecp.php?action=spaceblogs&op=add
于是定位到 admin/spacecp_spaceblogs.php
发现这个文件是zend encode过的。
并且在此目录中,也没有发现模板文件,看来他们是把程序和HTML代码混在一起了。

解决办法:
mv spacecp_spaceblogs.php spacecp_spaceblogs_huarong.php
然后新建一个 spacecp_spaceblogs.php
内容如下:

<?PHP
if (!empty($_POST['hash']) )
{
   //在这里检测输入的验证码是否正确。
include "spacecp_spaceblogs_huarong.php";
}
else
{
        include "spacecp_spaceblogs_huarong.php";
}
?>
<script>
var modify_the_form = document.getElementById("theform");
if (modify_the_form)
{
        //创建一个输入框,用来输入验证码
        var modify_input = document.createElement("input"); 
        modify_the_form.appendChild(modify_input);
        modify_input.name = "modify_test_code";
        //用同样的办法,可以加一个<img src='生成验证码图片的php文件'>
 
}
</script>

Top