读书人

验证码在服务器端判断时的有关问题

发布时间: 2012-03-05 11:54:03 作者: rapoo

验证码在服务器端判断时的问题
/* 以下是服务器端判断用的代码 */

If Session( "GetCode) ") <> Request.Form( "guestCode ") Then
'Response.Write( "Session= "&Session( "GetCode "))
'Response.Write( " <br /> Request= "&Request.Form( "guestCode "))
Session( "GetCode) ") = " "
Response.Write( " <script type= 'text/JavaScript '> ")
Response.Write( "alert( '验证码输入不正确! ');history.back() ")
Response.Write( " </script> ")
Response.End()
End If

/* 调试输出时发现,Session和Request中的值是一模一样的,但就是会提示验证码不正确!!! */


怎么回事啊?

备注:
页面使用UTF-8编码:

<%@LANGUAGE= "VBSCRIPT " CODEPAGE= "65001 "%>
<%Session.CodePage= "65001 "%>
<%Response.CodePage= "65001 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf-8 " />

[解决办法]
加个trim试试

读书人网 >ASP

热点推荐