print "Content-Type: text/html; Charset=Shift_JIS"
print ""
' ----------------------------------------------------------
' フォーム
print "<FORM method=get >"
print "<INPUT type=text name='Field1'>"
print "<INPUT type=text name='Field2'>"
print "<INPUT type=submit name=send value='送信'>"
print "</FORM>"
' ----------------------------------------------------------
' テーブル
print "<TABLE border=0 cellpadding=5 cellspacing=1 bgcolor=black>"
print "<TH bgcolor=silver>対象</TH><TH bgcolor=silver>値</TH>"
' ----------------------------------------------------------
' 環境変数 --> Process を使用
Set Env = Shell.Environment("Process")
print "<TR>"
td "QUERY_STRING"
td Env("QUERY_STRING")
print "</TR>"
' ----------------------------------------------------------
' GET データ
aData = Split( Env("QUERY_STRING"), "&" )
' ----------------------------------------------------------
if Ubound( aData ) >= 0 then
' デコードデスト
print "<TR>"
td "Field1"
aKeyValue = Split(aData(0), "=" )
td Decode(aKeyValue( 1 ))
print "</TR>"
print "<TR>"
td "Field2"
aKeyValue = Split(aData(1), "=" )
td Decode(aKeyValue( 1 ))
print "</TR>"
print "<TR>"
td "send"
aKeyValue = Split(aData(2), "=" )
td Decode(aKeyValue( 1 ))
print "</TR>"
end if
print "</TABLE>"
' ******************************************************
' % DECODE と + の変換
' ******************************************************
function Decode( strValue )
Dim strChar,strConvert,i,nCode
strConvert = ""
For i = 1 to Len( strValue )
strChar = Mid( strValue, i, 1 )
if strChar = "%" then
i = i + 1
strChar = Mid( strValue, i, 2 )
nCode = Cint( "&H" & strChar )
if &H81 <= nCode and nCode <= &H84 or _
&H88 <= nCode and nCode <= &H9f or _
&HE0 <= nCode and nCode <= &HEA then
i = i + 2
if Mid( strValue, i, 1 ) = "%" then
i = i + 1
strChar = strChar & Mid( strValue, i, 2 )
nCode = Cint( "&H" & strChar )
strConvert = strConvert & Chr(nCode)
i = i + 1
else
strChar = strChar & Hex(Asc( Mid( strValue, i, 1 ) ))
nCode = Cint( "&H" & strChar )
strConvert = strConvert & Chr(nCode)
end if
else
strConvert = strConvert & Chr(nCode)
i = i + 1
end if
else
if strChar = "+" then
strConvert = strConvert & " "
else
strConvert = strConvert & strChar
end if
end if
Next
Decode = strConvert
end function