Advertisement
Guest User

Login.asp

a guest
Mar 6th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>KellyM - Bank simulator - A02</title>
  4. <style>
  5. body{
  6. text-align: center;
  7. font-family:Roboto;
  8. }
  9. input{margin:10px 0; width: 100%}
  10. input[type=submit] {
  11. color: #FFF;
  12. border: 0px;
  13. width: 128px;
  14. height: 40px;
  15. text-transform: uppercase;
  16. }
  17. .depositBtn{background-color: forestgreen;}
  18. .depositBtn:hover{background-color: #1a691a;}
  19. .withdrawBtn{background-color: darkred;}
  20. .withdrawBtn:hover{background-color: #690101;}
  21. form {
  22. width: 260px;
  23. margin:10% auto;
  24. }
  25. .invisible{display: none;}
  26. </style>
  27. </head>
  28. <body>
  29. <%
  30. Dim username
  31. Dim pass
  32.  
  33. username = Request.QueryString("accountName")
  34. pass = Request.QueryString("password")
  35.  
  36. 'Dimension variables
  37. Dim Con
  38. Dim RS
  39. Dim strSQL
  40.  
  41. 'ADO connection objects
  42. Set Con = Server.CreateObject("ADODB.Connection")
  43. Set RS = Server.CreateObject("ADODB.RecordSet")
  44.  
  45. 'For MsAccess 2013 and later
  46. Con.provider = "Microsoft.ACE.OLEDB.12.0"
  47. 'For MS ACCess 2010 and Earlier
  48. Con.provider = "Microsoft.jet.OLEDB.4.0"
  49.  
  50. Con.ConnectionString = "C:\inetpub\wwwroot\asp\resources\bank\BankAccount.mdb"
  51. Con.Open
  52. strSQL = "Select * From Users"
  53.  
  54. Dim adOpenDynamic, adLockOptimistic
  55. adOpenDynamic = 2
  56. adLockOptimistic = 3
  57.  
  58. Rs.Open strSQL, Con, adOpenDynamic,adLockOptimistic
  59. Rs.Movefirst
  60.  
  61. Dim validUser
  62. Dim validPass
  63.  
  64. validUser = false
  65. validPass = false
  66.  
  67. Do While not RS.EOF
  68. if username = RS("accountName") Then
  69. validUser = true
  70. if pass = RS("password") Then
  71. validPass = true
  72. Else
  73. Response.Write("Password is incorrect. Please try again.")
  74. End if
  75. Exit Do
  76. End if
  77. Rs.MoveNext
  78. Loop
  79.  
  80. if validPass = true Then
  81. %>
  82. <div>
  83. <!-- Form to make transactions -->
  84. <form action='home.asp' method='get'>
  85. <%
  86. Response.Write ("<h1>Welcome " + username + "!</h1><input class='invisible' type='text' name='username' value='" + username + "'>")
  87. Response.Write ("<p>Make your transactions easily</p>")
  88. %>
  89. <input type="text" name="money"><br />
  90. <input class="withdrawBtn" type="submit" name="submit" value="withdraw">
  91. <input class="depositBtn" type="submit" name="submit" value="deposit">
  92. </form>
  93. </div>
  94. <% End if %>
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement