-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathd.ssf
More file actions
82 lines (75 loc) · 1.56 KB
/
d.ssf
File metadata and controls
82 lines (75 loc) · 1.56 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
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
81
82
echo sv("select 9*9*9")
echo "<hr>"
echo "<img src=1.jpg>"
echo rq("aaa")
echo "<table border=1>"
for i=1 to 10
color="red"
if i mod 2=0 then color="blue"
echo "<tr>"
echo "<td bgcolor='"& color &"'>" & i
next
echo "</table>"
function getPart(ByVal s,ByVal a,ByVal b)
dim iStart,strRight
if s<>"" then
iStart =instr(s,a)
if iStart<=0 then exit function
strRight=right(s,len(s)-iStart-len(a)+1)
iPos =instr(strRight,b)
if iPos>0 then
getPart=left(strRight,iPos-1)
getPart=trim(getPart)
else
getPart=""
end if
else
getPart=""
end if
end function
Class cDs
dim cols,vals,rowid_
Public default Function v(fld)
fld=lcase(fld)
If fld="rowid" Or fld="idx" Then
v=rowid_
Exit function
End If
For i=0 To UBound(cols)
If fld=LCase(cols(i)) Then
v=vals(i)
Exit function
End if
next
End Function
End Class
Function g(sql)
Dim sRet
sRet=query_sql(sql)
cols=getpart(sRet,"<cols>","</cols>")
rows=getpart(sRet,"<rows>","</rows>")
arrRows=Split(rows,"```")
Dim objRows()
ReDim objRows(UBound(arrRows))
For i=0 To UBound(arrRows)
Set objRows(i)=new cDs
objRows(i).rowid_=i+1
objRows(i).cols=Split(cols,",")
objRows(i).vals=Split(arrRows(i),"###")
next
g=objRows
End Function
pp=g("select * from test where 1=1")
For Each r In pp
echo "<hr>"
echo r("rowid") & ". "
echo r("uid")
echo r("pwd")
echo r("ÐÕÃû")
Next
echo "<hr>" & Now()
echo rq("a")
echo rq("name")
echo rq("txt")
echo "<hr>"
echo "<form method=post action='?a=aaa&name=´óß÷ß÷'><input type=text name=txt value='ß÷Íú123zxy'><input type=submit></form>"