表单POST ASP经典XMLHTTP [英] Form post asp classic xmlhttp
问题描述
我试图做的另一个网站,是不是我的表单POST,但
我不能给TA错误。
I'm trying to do a form post from another site that is not mine, but I am not able ta give error.
有后安装这样的网站上:
There on the site the post is mounted like this:
<a href="javascript:document.result.submit()" class="lnk-more">Veja o resultado da enquete anterior »</a>
<br /><br />
<form name="result" action="http://enquete.terra.com.br/enquete.cgi" method="post">
<input type="hidden" name="id_enquete" value="144143">
<input type="hidden" name="opcao" value="0">
</form>
和我骑在ASP脚本,使这一职位为:
And I'm riding in the asp script to make this post as:
<%
Dim objHttp
Dim str
str = "id_enquete=144143&opcao=0"
Set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.Open "POST", "http://enquete.terra.com.br/enquete.cgi", false
objHttp.setRequestHeader "Host", "http://enquete.terra.com.br"
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1"
objHttp.setRequestHeader "Content-Length", Len(str)
objHttp.Send str
Response.Write(objHttp.ResponseText)
Set objHttp = nothing
%>
但不是这方面的工作,没有人知道如何或知道我在哪里
错误??
But not this working, does anyone know how or know where I am wrong??
感谢
推荐答案
code看起来真实的;为什么你得到内部服务器错误的原因是因为错误的IIS设置是不是在调试模式。
Code looks true; the reason why you get "Internal Server Error" is because your IIS settings for error is not in the debug mode.
您应该更改IIS设置发送错误信息到浏览器,那么你可以看到浏览器上的实际的错误信息;这可能是由Msxml2.ServerXMLHTTP对象的版本引起的。
You should change your IIS settings to "Send error messages to Browser" then you can see the actual error message on the browser; which is probably caused by version of the Msxml2.ServerXMLHTTP object.
这篇关于表单POST ASP经典XMLHTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!