<%if session("username") = "Carissa" then else response.redirect("../index.htm") end if %>
<%if session("username") = "" then response.redirect("../index.htm") end if %>

| Help | Contact | About Us
Admin Section
<% strDB = "Borel.mdb" 'Database MapPath Set MyConn=Server.CreateObject("ADODB.Connection") MyConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ "DATA SOURCE=" & server.MapPath(strDB) select case (request("action")) case "add" addUser case "delete" deleteUser case default menu end select ' =========================================================== sub addUser() ' =========================================================== if request("username") <> "" then exists="no" MySQL="SELECT * from tbluser" Set MyRs=MyConn.Execute(MySQL) while not MyRs.EOF if MyRs("username") = request("username") then exists="true" response.write(" That username already exists ") response.write(" Try Again ") end if MyRs.MoveNext() wend if exists="no" then response.write(" That username does not exists ") MySQL="INSERT INTO tbluser (username) VALUES (""" & request("username") & """)" Set MyRs=MyConn.Execute(MySQL) MySQL="INSERT INTO tblsurvey (username) VALUES (""" & request("username") & """)" Set MyRs=MyConn.Execute(MySQL) MySQL="INSERT INTO tblcomments (username) VALUES (""" & request("username") & """)" Set MyRs=MyConn.Execute(MySQL) response.redirect("admin.asp") end if end if end sub ' =========================================================== sub deleteUser() ' =========================================================== if request("userlist") <> "" then MySQL="delete * from tbluser Where username = '" & request("userlist") & "'" Set MyRs=MyConn.Execute(MySQL) MySQL="delete * from tblsurvey Where username = '" & request("userlist") & "'" Set MyRs=MyConn.Execute(MySQL) MySQL="delete * from tblcomments Where username = '" & request("userlist") & "'" Set MyRs=MyConn.Execute(MySQL) response.redirect("admin.asp") end if response.write("NAME: " & request("userlist")) end sub ' =========================================================== sub menu() ' =========================================================== MySQL="select * from tbluser" Set MyRs=MyConn.Execute(MySQL) response.write(" ") response.write(" ") response.write("") response.write(" Hello Carissa, ") response.write("What would you like to do? ") response.write(" Create a new user:(Case Sensitive) ") response.write(" ") response.write("") response.write(" ") response.write("") response.write("") response.write("Delete a User ") response.write(" ") response.write(" ") response.write(" Main Page ") response.write("") response.write(" ") response.write(" ") end sub %>
Home | Zoom Maps | View all Maps |  |