Repository navigation
Expand file tree
/
Copy pathremove_collection.asp
More file actions
36 lines (34 loc) · 1.64 KB
/
Copy pathremove_collection.asp
File metadata and controls
36 lines (34 loc) · 1.64 KB
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
<%
gid=request.QueryString("gid")
uid=Session("user")
pass=Session("pass")
Function ReadFromTextFile (FileUrl,CharSet)
dim str
set stm=server.CreateObject("adodb.stream")
stm.Type=2
stm.mode=3
stm.charset=CharSet
stm.open
stm.loadfromfile server.MapPath(FileUrl)
str=stm.readtext
stm.Close
set stm=nothing
ReadFromTextFile=str
End Function
strconnection=ReadFromTextFile("other/odbc.ini","utf-8")
set conn = server.createobject("adodb.connection")
conn.open strconnection
sql="select * from user where uid='"&Session("user")&"'and password='"&Session("pass")&"'"
set rs=conn.execute(sql)
if rs.bof then
rs.close
set rs=nothing
else
rs.close
set rs=nothing
sql2="delete from collection where uid='"&uid&"' and gid='"&gid&"'"
conn.execute(sql2)
end if
conn.close
response.redirect "collection.asp"
%>