Guest User

Untitled

a guest
Jun 27th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <html dir="rtl">
  2. <head>
  3. </head>
  4. <body>
  5. <%
  6. ' Create a command object. This object serves to run our queries
  7. Set Cm = Server.CreateObject("ADODB.Connection")
  8.  
  9. ' Specify the system DSN path
  10.  
  11. Cm.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
  12. "Dbq=" & Server.MapPath("db\mydb.mdb") & ";" & _
  13. "Uid=admin;" & _
  14. "Pwd=;"
  15.  
  16. ' Now it's time for the query. We need to check the user information
  17. ' against the table Users
  18. mySql = "SELECT * FROM users WHERE " & _
  19. "userName='" & Request.Form("userName") & "' AND " & _
  20. "pass='" & Request.Form("Password") & "' "
  21.  
  22. ' Retrieve the results in a recordset object
  23. Set Rs = Cm.Execute(mySql)
  24.  
  25. If Rs.EOF Then
  26. Session("userGood") =0
  27. Cm.close
  28. Response.Redirect ("Home.html")
  29. Else
  30. Session("userGood") = 1
  31. Session("userName") = Rs("userName")
  32. Cm.close
  33. Response.Redirect ("home.asp")
  34. End If
  35.  
  36. Cm.close
  37. Set Cm = Nothing
  38. Set Rs = Nothing
  39. %>
  40.  
  41. </a><br />
  42. <a href="Home.html">
  43. חזרה לתפריט ראשי
  44. </a>
  45. </body>
  46. </html>
Add Comment
Please, Sign In to add comment