-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditUser.asp
80 lines (63 loc) · 1.97 KB
/
EditUser.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<%
'Session Timeout Start
Session("STimeoutError")=""
if Session("STxtUserEmail")="" then
Session("STimeoutError")="Your Session has been Timed Out! Please Login to continue"
response.Redirect("Login.asp")
end if
%>
<!--#include file="ValidateLogin.asp"-->
<%
'Variable Declaration Start
Dim Name
Dim Email
Dim Password
Dim Id
'Dim ErrorFound
'Dim Conn
'Dim CS
'Variable Declaration End
'Initializing Variables Start
Name = request.Form("UserName")
Id = request.Form("TxtId")
Email = request.Form("UserEmail")
password = request.Form("UserPass")
ErrorFound=false
'Initializing Variables End
'response.write (Id)
'response.end
Session("ErrorName")=""
Session("ErrorEmail")=""
Session("ErrorPassword")=""
if Name = "" or isnull(name)=true then
Session("ErrorName") = "User Name cannot be NULL"
ErrorFound=True
end if
if Email = "" then
Session("ErrorEmail") = "User Email cannot be NULL"
ErrorFound=True
end if
if Password = "" then
Session("ErrorPassword") = "Password cannot be NULL"
ErrorFound=True
end if
If ErrorFound=true then
response.Redirect("NewUser.asp")
end if
'Opening Db Start
Set Conn = Server.CreateObject("ADODB.Connection")
CS = "Driver={SQL Server};Server=NABEELS-WORK;Database=HomeExpenseTracker;User Id=homeexpense;Password=Nabeel30;"
Conn.Open CS
'Opening Db End
'Edit User Start
Set RSLogin = Server.CreateObject("ADODB.RecordSet")
RSLogin.Open "SELECT * FROM LoginDetails WHERE(LoginId = " & id & ")",Conn
QryStr = "UPDATE LoginDetails SET UserFullName = '" & Name & "',UserEmail = '" & Email & "',Password = '" & Password & "' WHERE (LoginId = " & id & ")"
'response.write(qrystr)
'response.end
Conn.Execute QryStr
'End
Conn.Close
set conn = nothing
response.Redirect("Users.asp")
%>