-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupplier.asp
56 lines (42 loc) · 1.76 KB
/
supplier.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
<%@ Language="VBScript" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<%
if session("empid") = "" then
response.redirect("sessionTimedOut.asp")
end if
fname = Request.Form("first_name")
lname = Request.Form("last_name")
email = Request.Form("email")
phone = Request.Form("phone")
address = Request.Form("address")
city = Request.Form("city")
state = Request.Form("state")
pincode = Request.Form("zip")
iname = Request.Form("iname")
Dim Connection
Dim Recordset
Dim SQL
Set Connection = Server.CreateObject("ADODB.Connection")
Set Recordset = Server.CreateObject("ADODB.Recordset")
Connection.Open "DSN=csidsn"
SQL = "select * from supplier"
Recordset.Open SQL,Connection
Set Recordset = Server.CreateObject("ADODB.Recordset")
SQL = "insert into supplier (f_name,l_name,email,phone,address,city,state,pincode,itemno) values ('"& fname &"','"&lname&"','"&email&"',"&phone&",'"&address&"','"&city&"','"&state&"','"&pincode&"',"&iname&");"
Connection.Execute SQL,recaffected
if err<>0 then
response.write "No permissions to write"
else
response.write "<head><title>Success</title></head><p style='font-size:50px;color:rgba(0, 255, 33, 0.90);'>Supplier Added Successfully <a href=supplier0.asp>Take me back</a></p>"
end if
Set Recordset=nothing
Set Connection=nothing
%>
<body>
</body>
</html>