注意事项:在DIY前,请你先对要修改的模板进行备份。
php学习之家http://www.444p.com
需要修改的是以下这些内容:
1、新建生成图片的文件YanZhengMa.php ,代码如下。保存完之后上传到Admin目录。 php学习之家http://www.444p.com
本文来自 www.444p.com
session_start();
session_register("login_check_number");
$img_height=24;
$img_width=100;
if($HTTP_GET_VARS["act"]== "init"){
for($Tmpa=0;$Tmpa<4;$Tmpa++){
$nmsg.=dechex(rand(0,15));
}
$HTTP_SESSION_VARS[login_check_number] = $nmsg;
$aimg = imageCreate($img_width,$img_height);
ImageColorAllocate($aimg, 255,255,255);
$black = ImageColorAllocate($aimg, 0,0,0);
ImageRectangle($aimg,0,0,$img_width-1,$img_height-1,$black);
for ($i=1; $i<=100; $i++) {
imageString($aimg,1,mt_rand(1,$img_width-4),mt_rand(1,$img_height-7),"*",imageColorAllocate($aimg,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255)));
}
for ($i=0;$i<strlen($HTTP_SESSION_VARS[login_check_number]);$i++){
imageString($aimg, mt_rand(3,5),$i*$img_width/4+mt_rand(1,10),mt_rand(1,$img_height/4), $HTTP_SESSION_VARS[login_check_number][$i],imageColorAllocate($aimg,mt_rand(0,100),mt_rand(0,150),mt_rand(0,200)));
}
Header("Content-type: image/png");
ImagePng($aimg);
ImageDestroy($aimg);
}
?>
2、修改admin目录下的adminfunctions.php
在
后增加两行: www.444p.com版权所有
www.444p.com
echo " <td width='232'><font class='normalfont'><input class=text type='text' name='number' value=''></font></td></tr>";
3、修改admin目录下的global.php和manage目录下的global.php
在 本文来自 www.444p.com
后增加一行:
在 www.444p.com
后面增加4行 php学习之家
loginlog($_POST[username],$_POST[password],"Referer: ".getenv("HTTP_REFERER"));
displaylogin();
}else{
还需要在 php学习之家http://www.444p.com
} else {
loginlog($_POST[username],$_POST[password],"Referer: ".getenv("HTTP_REFERER"));
displaylogin();
}
后面增加一个反括号
4、注意事项
admin中的global.php和manage中的global.php需要分别修改,不能相互覆盖,因为他们的if ($_POST[action]=="login") 后面的原始代码不同。 本文来自 www.444p.com
5、建议
为了更好的提高安全性,还可以在manage中的各个控制文件中做限制,比如不让manage管理员编辑和删除30天前的内容。这样做的好处是即便有manage帐号泄露或者误操作,都不至于引起很严重的后果。
www.444p.com版权所有
6、效果图 www.444p.com
















