login.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="inc/config.asp"-->
  3. <!--#include file="inc/conn.asp"--> 
  4. <%
  5. if NOT isempty(request("LoginSubmit")) then
  6. dim admin,password
  7. admin=replace(trim(request("Name")),"'","")
  8. password=md5(replace(trim(request("Pws")),"'",""))
  9. set rs=server.CreateObject("adodb.recordset")
  10. rs.Open "select * from [admin] where admin='"&admin&"' and password='"&password&"' " ,conn,1,1
  11. if not(rs.bof and rs.eof) then
  12. if password=rs("password") then
  13. session("admin")=trim(rs("admin"))
  14. session("rank")=int(rs("rank"))
  15. session.Timeout=sessionLife
  16. rs.Close
  17. set rs=nothing
  18. response.Redirect "mpro.asp"
  19. else
  20. call MsgBox("登录失败!","Back","None")
  21. end if
  22. else
  23. call MsgBox("非法登陆!","Back","None")
  24. end if
  25. end if
  26. %>
  27. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  28. <html>
  29. <head>
  30. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  31. <title>406网络书店</title>
  32. <link href="../style.css" rel="stylesheet" type="text/css">
  33. <style type="text/css">
  34. <!--
  35. .table {font-family:Verdana;font-size:10px;color:#ffffff}
  36. .style2 {color: #66FF00}
  37. -->
  38. </style>
  39. </head>
  40. <body>
  41. <!--#include file="head.htm"-->
  42. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  43.   <tr>
  44.     <td align="left" valign="top"><br>      <form name="admininfo" method="post" action="" >
  45.         <table  width="260" border="0" align="center" cellpadding="3" cellspacing="5">
  46.           <tr bgcolor="#FFFFFF">
  47.             <td colspan="2"><table border="0" align="left" cellpadding="0" cellspacing="0">
  48.               <tr>
  49.                 <td width="18"><img src="../images/w.gif" width="18" height="18"></td>
  50.                 <td width="76" style="color:#415373">管理员登录</td>
  51.               </tr>
  52.             </table></td>
  53.           </tr>
  54.           <tr bgcolor="#FFFFFF">
  55.             <td width="59" bgcolor="#FFFFFF">管理员:</td>
  56.             <td width="174"><input name="Name" type="text" id="admin2" size="12"></td>
  57.           </tr>
  58.           <tr bgcolor="#FFFFFF">
  59.             <td bgcolor="#FFFFFF">密&nbsp;&nbsp;码:</td>
  60.             <td><input name="Pws" type="password" id="Pws" size="12"></td>
  61.           </tr>
  62.           <tr bgcolor="#FFFFFF">
  63.             <td colspan="2" align="center"><input name="LoginSubmit" type="submit" id="LoginSubmit"  value="登录">
  64.               <input  type="reset" name="Submit2" value="清除" >
  65.             </td>
  66.           </tr>
  67.         </table>
  68.     </form>      </td>
  69.   </tr>
  70. </table>
  71. </body>
  72. </html>