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

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <%
  6. if NOT isempty(request("LoginSubmit")) then
  7. dim username,password
  8. username=replace(trim(request("username")),"'","")
  9. password=md5(replace(trim(request("password")),"'",""))
  10. 'if username="" or password="" then
  11. ' call MsgBox("对不起,登录失败,请检查您的登录名和密码","None","None")
  12. 'end if
  13. set rs=server.CreateObject("adodb.recordset")
  14. rs.Open "select * from [user] where username='"&username&"' and password='"&password&"' " ,conn,1,3
  15. if not(rs.bof and rs.eof) then
  16. if password=rs("password") then
  17. response.Cookies(cookieName)("username")=trim(request("username"))
  18. response.Cookies(cookieName)("vip")=rs("vip")
  19. rs("lastvst")=now()
  20. rs("loginnum")=rs("loginnum")+1
  21. rs.Update
  22. rs.Close
  23. set rs=nothing
  24. response.redirect "muser.asp"
  25. else
  26. call MsgBox("对不起,您的用户名或密码有误!","Back","None")
  27. end if
  28. else
  29. call MsgBox("对不起,您的用户名或密码有误!","Back","None")
  30. end if
  31. end if
  32. %>
  33. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  34. <html>
  35. <head>
  36. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  37. <title>我家网络书店</title>
  38. <link href="style.css" rel="stylesheet" type="text/css">
  39. <style type="text/css">
  40. <!--
  41. .style2 {color: #000000}
  42. -->
  43. </style>
  44. </head>
  45. <body>
  46. <!--#include file="head.htm"-->
  47. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  48.   <tr>
  49.     <td width="219" align="left" valign="top"><!--#include file="left.asp"--></td>
  50.     <td width="561" align="left" valign="top"> <br>      <br>        <table cellpadding="0" cellspacing="0" border="0">
  51.         <tr>
  52.           <td width="18"><img src="images/w.gif"></td>
  53.           <td style="color:#415373">用户登录</td>
  54.         </tr>
  55.         </table>        <br>        <form action="" method="post" name="loginfo" id="loginfo">
  56.           <table border="0" cellpadding="0" cellspacing="10" class="t1">
  57.             <tr>
  58.               <td width="170" height="22" align="right" ><span class="style2">用户名:</span></td>
  59.               <td width="235" height="22" ><input name="username" type="text" class="inputstyle" id="username">
  60.               </td>
  61.             </tr>
  62.             <tr>
  63.               <td height="22" align="right" ><span class="style2">密码:</span></td>
  64.               <td height="22" ><input name="password" type="password" class="inputstyle" id="password"></td>
  65.             </tr>
  66.             <tr align="center">
  67.               <td height="22" colspan="2" ><input type="reset" name="Submit" value="重置">
  68.                   <input name="LoginSubmit" ONCLICK="return checkuu();" type="submit" id="LoginSubmit" value="登录">
  69.                   <script language="JavaScript">
  70. <!--
  71.   function checkuu()
  72. {
  73.     if(checkspace(document.loginfo.username.value)) {
  74. document.loginfo.username.focus();
  75.     alert("用户名不能为空!");
  76. return false;
  77.   }
  78.     if(checkspace(document.loginfo.password.value)) {
  79. document.loginfo.password.focus();
  80.     alert("密码不能为空!");
  81. return false;
  82.   }
  83.   }
  84. //-->
  85.                   </script></td>
  86.             </tr>
  87.           </table>
  88.       </form></td>
  89.   </tr>
  90. </table>
  91. <!--#include file="foot.htm"-->
  92. </body>
  93. </html>