请问:如何检测ASP脚本是用POST还是用GET方法从HTML表单中获得数据?

如题所示,请大虾指教,谢谢!
---------------------------------------------------------------

当一个脚本用POST方法提交给脚本时,条件request.servervariables("CONTENT_LENGHT")>0取值为TRUE;
如果使用的是GET方法,则条件request.servervariables("QUERY_STRING")<>""取值为TRUE。
---------------------------------------------------------------

if request.servervariables("request_method") = "post" then
。。。
---------------------------------------------------------------

用 Request.ServerVariables("REQUEST_METHOD")参数
比如
If Request.ServerVariables("REQUEST_METHOD")="POST" then
else
If If Request.ServerVariables("REQUEST_METHOD")="GET" then
end if
end if

---------------------------------------------------------------

1<table border="1" bordercolorlight="#FFFFFF" cellpadding="0" cellspacing="0" width="100%">
2<tr>
3<td width="23%">
4<p align="center">ServerVariables</p></td>
5<td width="77%">
6<p align="center">Value</p></td>
7</tr>   

for each name in Request.ServerVariables

1<tr>
2<td width="23%">  ```
3=name
4```</td>
5<td width="77%">  ```
6=Request.ServerVariables(name)
7```</td>
8</tr>   

next

1</table>
Published At
Categories with Web编程
comments powered by Disqus