| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 912 人关注过本帖
标题:怎么把验证码加到登录页?
取消只看楼主 加入收藏
lemzner
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-6-29
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
怎么把验证码加到登录页?
<!--#include file=conn.asp-->
<%
if request("act")="check" then
    set rs=server.createobject("adodb.recordset")
    rs.open "select * from admin where username='"&trim(request.form("username"))&"' and password='"&trim(request.form("password"))&"'",conn,1,1
    if rs.eof and rs.bof then
        response.write "<script>alert('登陆失败!用户名或者密码错误.');history.back(1)</script>"
        response.end
    else
        session("user")=rs("username")
        response.redirect "admin.asp"
    end if
    rs.close
    set rs=nothing
    conn.close
    set conn=nothing
end if        
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理登陆</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<%
if request("XHType")="" or request("XHType")="login" then
    call login()
elseif request("XHType")="logout" then
    call logout()
end if        
%>
<script language="javascript">
function check(){
    if(form1.username.value==""){
        alert("用户名不能为空!");
        form1.username.focus();
        return false;}
    if(form1.password.value==""){
        alert("密码不能为空!");
        form1.password.focus();
        return false;}
    return true;
}            
</script>
<body bgcolor="#F0F0F0">
<%
sub logout()
    session("user")=""
    call login()
end sub
%>
<%sub login()%>

<div align="center">
 <p> </p>
    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="200">
        <tr>
            <td>
            <div align="center">
                <table border="1" width="50%" id="table2" cellspacing="1" cellpadding="5" bgcolor="#C7E8FA" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
                    <form action=?act=check method=post name=form1 onSubmit="return check()">
                    <tr>
                        <td bgcolor="#008080">
                        <p align="center"><font color="#FFFFFF"><b>管理登陆</b></font></td>
                    </tr>
                    <tr>
                        <td>
                        <p align="center"><b>用户名:</b><input type=text name=username></td>
                    </tr>
                    <tr>
                        <td>
                        <p align="center"><b>密码:</b>
                          <input type=password name=password size="21"></td>
                    </tr>
                    <tr>
                        <td>
                        <p align="center"><input type=submit name=submit value=登陆></td>
                    </tr>
                    </form>
                </table>
            </div>
            </td>
        </tr>
    </table>
</div>
<%end sub%>
</body>

</html>
搜索更多相关主题的帖子: 验证 登录 
2010-06-29 10:10
快速回复:怎么把验证码加到登录页?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038155 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved