試驗如下:
提交Form代碼(Test.htm):
<Html>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<script language=Javascript>
function Test()
{
strA = "submit1=Submit&text1=scsdfsd"; file://Looks like QueryString,But there's no "?" here!
var oReq = new ActiveXObject("MSXML2.XMLHTTP");
oReq.open("POST","http://ServerName/VDir/TstResult.ASP",false);
oReq.setRequestHeader("Content-Length",strA.length);
oReq.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
oReq.send(strA);
txt1.document.write(oReq.responseText);
}
</script>
</HEAD>
<BODY>
<INPUT type=button value="go!" onclick="Test()"><br>
<IFRAME style="width:95%;height=85%;" name=txt1></IFRAME>
</BODY>
</Html>
這是接受Form數據的ASP,很簡單。
<Html>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<TABLE border="1" cellpadding=0 cellspacing=0>
<%For Each Key In Request.Form%>
<TR>
<TD><%=Key%></TD>
<TD><%=Request.Form(Key)%></TD>
</TR>
<%Next%>
</TABLE>
</BODY>
</Html>
Enjoy it! :)