-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.asp
37 lines (33 loc) · 1.09 KB
/
index.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%@ Language="VBScript" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>login</title>
</head>
<body>
<form method="Post" action="Page3.asp">
Email <input type="email" name="email" placeholder="abc@abc.com" /><br>
Password <input type="password" name="pass" placeholder="password" /><br>
<input type="submit" value="submit"/>
</form>
</body>
<%
db_connection = "Provider=SQLOLEDB.1:Server=WEBDEL33\SQL2008R2;Database=Kavith;Pwd=Pwd4sql2008;"
set conn = server.createobject("adodb.connection")
set Cmd = server.CreateObject("ADODB.Command)
conn.open(db_connection)
set rs = server.CreateObject("ADODB.RecordSet")
%>
<%
Dim name,age
email = Request.Form("email")
pass = Request.Form("pass")
sSQL="SELECT id, email, password FROM users WHERE email="&email&",password="&pass,
var user = conn.execute(sSQL)
if(user==null)
Response.Write("<script>alert('login failed')</script>");
else
Response.Write("<script>alert('sucessfully logged in')</script>");
%>
</html>