Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>KellyM - Bank simulator - A02</title>
- <style>
- body{
- text-align: center;
- font-family:Roboto;
- }
- input{margin:10px 0; width: 100%}
- input[type=submit] {
- color: #FFF;
- border: 0px;
- width: 128px;
- height: 40px;
- text-transform: uppercase;
- }
- .depositBtn{background-color: forestgreen;}
- .depositBtn:hover{background-color: #1a691a;}
- .withdrawBtn{background-color: darkred;}
- .withdrawBtn:hover{background-color: #690101;}
- form {
- width: 260px;
- margin:10% auto;
- }
- .invisible{display: none;}
- </style>
- </head>
- <body>
- <%
- Dim username
- Dim pass
- username = Request.QueryString("accountName")
- pass = Request.QueryString("password")
- 'Dimension variables
- Dim Con
- Dim RS
- Dim strSQL
- 'ADO connection objects
- Set Con = Server.CreateObject("ADODB.Connection")
- Set RS = Server.CreateObject("ADODB.RecordSet")
- 'For MsAccess 2013 and later
- Con.provider = "Microsoft.ACE.OLEDB.12.0"
- 'For MS ACCess 2010 and Earlier
- Con.provider = "Microsoft.jet.OLEDB.4.0"
- Con.ConnectionString = "C:\inetpub\wwwroot\asp\resources\bank\BankAccount.mdb"
- Con.Open
- strSQL = "Select * From Users"
- Dim adOpenDynamic, adLockOptimistic
- adOpenDynamic = 2
- adLockOptimistic = 3
- Rs.Open strSQL, Con, adOpenDynamic,adLockOptimistic
- Rs.Movefirst
- Dim validUser
- Dim validPass
- validUser = false
- validPass = false
- Do While not RS.EOF
- if username = RS("accountName") Then
- validUser = true
- if pass = RS("password") Then
- validPass = true
- Else
- Response.Write("Password is incorrect. Please try again.")
- End if
- Exit Do
- End if
- Rs.MoveNext
- Loop
- if validPass = true Then
- %>
- <div>
- <!-- Form to make transactions -->
- <form action='home.asp' method='get'>
- <%
- Response.Write ("<h1>Welcome " + username + "!</h1><input class='invisible' type='text' name='username' value='" + username + "'>")
- Response.Write ("<p>Make your transactions easily</p>")
- %>
- <input type="text" name="money"><br />
- <input class="withdrawBtn" type="submit" name="submit" value="withdraw">
- <input class="depositBtn" type="submit" name="submit" value="deposit">
- </form>
- </div>
- <% End if %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement