这个问题很多人都在问,论坛里确实没有,我在这里转发一下,这个修改方法是
长江的,也是唯一的修改方法!
说明一下,出现此问题不是PJ程序本身的问题,主要是由于用户修改了首页侧边栏登录面板造成的,当留言或评论时,由于侧边栏登录框里也有验证码,一个页面有两个验证码出现,PJBLOG加载页面的顺序是先加载内容,才加载侧边的东西,而Session("GetCode")只有一个,Session("GetCode")记录的是最后一个,也就是用户登陆面板的这个,所以验证码会出错。那当你评论的时候,输入的是评论里的验证码,如果你输入登录面板的验证码肯定不会错误了,可是使用习惯不会这样,所以要修改一下!以下是修改方法,修改之前请备份相关文件!
详情查看:
http://www.cjiang.net/article.asp?id=41
1、复制一份common下的GetCode.asp,并改名为GetCode_Post.asp,搜索
复制内容到剪贴板
代码:
code = Int(Rnd * 9000 + 1000)
If showErrorImg Then
Session("GetCode") = Int(Rnd * 9000 + 1000)
else
Session("GetCode") = code
End If替换成
复制内容到剪贴板
代码:
code = Int(Rnd * 9000 + 1000)
If showErrorImg Then
Session("GetCode_Post") = Int(Rnd * 9000 + 1000)
else
Session("GetCode_Post") = code
End If2、打开common/function.asp
搜索
复制内容到剪贴板
代码:
Function getcode()
getcode= "<img id=""vcodeImg"" src=""about:blank"" onerror=""this.onerror=null;this.src='common/getcode.asp?s='+Math.random();"" alt=""验证码"" title=""看不清楚?换一张"" style=""margin-right:40px;cursor:pointer;width:40px;height:18px;margin-bottom:-4px;margin-top:3px;"" onclick=""src='common/getcode.asp?s='+Math.random()""/>"
End Function在下边添加
复制内容到剪贴板
代码:
Function getcode2()
getcode2= "<img id=""vcodeImg1"" src=""about:blank"" onerror=""this.onerror=null;this.src='common/getcode_post.asp?s='+Math.random();"" alt=""验证码"" title=""看不清楚?换一张"" style=""margin-right:40px;cursor:pointer;width:40px;height:18px;margin-bottom:-4px;margin-top:3px;"" onclick=""src='common/getcode_post.asp?s='+Math.random()""/>"
End Function3、打开common/library.asp
搜索
复制内容到剪贴板
代码:
&getcode()&替换为
复制内容到剪贴板
代码:
&getcode2()&4、这个可改可不改,一般我们该过了登陆面扳,基本上不会到这个页面登陆,不过为了完整,还是写出来。
打开login.asp
搜索
复制内容到剪贴板
代码:
<%=getcode()%>替换为
复制内容到剪贴板
代码:
<%=getcode2()%>5、打开common/checkUser.asp
搜索
复制内容到剪贴板
代码:
IF cstr(lcase(Session("GetCode")))<>cstr(lcase(validate)) then替换成
复制内容到剪贴板
代码:
IF cstr(lcase(Session("GetCode_Post")))<>cstr(lcase(validate)) then