首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

为什么验证码就是显示不出来呢解决方案

2012-03-05 
为什么验证码就是显示不出来呢!--#includefileinclude/conn.asp --!--#includefileinclude/md5.as

为什么验证码就是显示不出来呢
<!--#include   file   =   "include/conn.asp "-->
<!--#include   file   =   "include/md5.asp "-->
<!--#include   file   =   "include/function.asp "-->
<%
      if   IsEmpty(Session( "Passed "))   then
            Session( "Passed ")   =   False
      End   if

    if   Session( "Passed ")   =   False   then
          UserName   =   Trim(Request.form( "UserName "))
          UserPwd   =   Request.form( "password ")

          if   UserName   =   " "   or   password   =   " "   then
                Errmsg   =   "如果您是本站会员,请在此登陆! "
          else
          If   not   IsNumeric(Request.Form( "confirm "))   Then
          Response.Write   " <script> alert( '你输入的验证码为非数字! '); </script> "
                  Response.End
                End   If
                If   (int(Session( "SafeCode "))=int(Request.Form( "confirm ")))   Then
set   rs   =   server.createobject( "adodb.recordset ")
sql   =   "Select   *   from   user   where   UserName   =   ' "&UserName& " ' "
rs.open   sql,conn,1,3
if   rs.EOF   then
Errmsg   =   "用户不存在 "
conn.Close
Set   conn   =   nothing
else
if   md5(UserPwd) <> rs.Fields( "UserPwd ")   then
Errmsg   =   "密码不正确 "
conn.Close
Set   conn   =   nothing
else  
Errmsg   =   " "
Session( "Passed ")   =   True
Session( "UserName ")   =   rs.Fields( "UserName ")
Session( "Id ")   =   rs.Fields( "Id ")
end   if
end   if
  Else
  Errmsg   =   "验证码输入错误! "
  End   If
          end   if
    end   if
    if   Not   Session( "Passed ")   Then
  %>
<html>
<head>
<title> login </title>
<link   href= "css/style.css "   rel= "stylesheet "   type= "text/css "   /> <style   type= "text/css "> </style>
</head>

<body>
<script   language   =   "VBScript ">
function   ChkFields()
      If   document.MyForm.UserName.value   = " "   Then
      window.alert( "请输入用户名! ")
      return   false
      End   If
      If   document.MyForm.password.value   = " "   Then
      window.alert( "请输入密码! ")


      return   false
      End   If
      If   document.MyForm.confirm.value   =   " "   Then
      window.alert( "请输入验证码! ")
return   false
      End   If
      return   true
End   Function
</script>
<form   name= "loginform "   method= "post "   action= " "   onsubmit   =   "return   ChkFields() ">
<table   width= "333 "   height= "216 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 ">
    <tr>
        <td   background= "image/daohangbeijing.gif "> <table   width= "333 "   height= "261 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 "   align= "center ">
            <tr>
                <td   height= "106 "> <table   width= "333 "   height= "106 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 ">
                    <tr>
                        <td   height= "80 "> &nbsp; </td>
                    </tr>
                    <tr>
                        <td   height= "26 "   align= "center "   valign= "bottom "   class= "ziti ">         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <%=Errmsg%> </td>
                    </tr>
                </table> </td>
            </tr>
            <tr>
                <td   height= "155 "   align= "center "   valign= "top "> <table   width= "200 "   height= "130 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 ">
                        <tr>
                            <td   height= "110 "   colspan= "4 "   align= "right "   valign= "top "> <table   width= "160 "   height= "75 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 ">
                                    <tr>
                                        <td   width= "50 "   height= "25 "   align= "right "   class= "ziti "> 用户名: </td>


                                        <td   align= "left ">
                                            <label>
                                                <input   name= "username "   type= "text "   class= "input3 "   />
                                            </label>                                         </td>
                                        </tr>
                                    <tr>
                                        <td   width= "50 "   height= "25 "   align= "right "   class= "ziti "> 密码: </td>
                                        <td   align= "left "> <input   name= "password "   type= "password "   class= "input3 "   /> </td>
</tr>
                                    <tr>
                                        <td   width= "50 "   height= "25 "   align= "right "   class= "ziti "> 验证码: </td>
                                        <td   align= "left "> <input   name= "confirm "   type= "text "   class= "input4 "   /> <%call   GetSafeCode()%> </td>
                                        </tr>
                            </table>
                                <table   width= "160 "   height= "35 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 ">
                                    <tr>
                                        <td   width= "40 "   align= "center "> <table   width= "150 "   height= "30 "   border= "0 "   cellpadding= "0 "   cellspacing= "0 ">


                                            <tr>
                                                <td   align= "center "   class= "ziti "> <input   type= "image "   value= "botton "   src= "image/daohanglogin.gif "   width= "150 "   height= "30 "> </td>
                                            </tr>
                                        </table> </td>
                                    </tr>
                                </table> </td>
                        </tr>
                        <tr>
                            <td   width= "40 "   height= "20 "   align= "right "   class= "ziti "> &nbsp; </td>
                            <td   width= "60 "   align= "left "   valign= "bottom "   class= "ziti "> <a   href= "members/user_reg.asp "> <font   color= "#FFFFFF "> 用户注册 </font> </a> </td>
                            <td   width= "90 "   align= "right "   valign= "bottom "   class= "ziti "> <a   href= "# "> <font   color= "#FFFFFF "> 找回密码 </font> </a> </td>
                            <td   width= "10 "   align= "right "   class= "ziti "> &nbsp; </td>
                        </tr>
                </table> </td>
            </tr>
        </table> </td>
    </tr>
</table>
</form>
</body>
</html>
<%response.end
    End   if
  %>


[解决办法]
http://blog.csdn.net/snlixing/archive/2007/04/19/1570856.aspx

td width= "50 " height= "25 " align= "right " class= "ziti "> 验证码: </td>
<td align= "left "> <input name= "confirm " type= "text " class= "input4 " src= " <%call GetSafeCode()%> "/> </td>

热点排行