怪了,idhttp post后得不到结果 ( 积分: 100 )

  • 主题发起人 robertliucd
  • 开始时间
R

robertliucd

Unregistered / Unconfirmed
GUEST, unregistred user!
我想自动提交表单数据,用twebbrowser自动填写表单内容提交可以得到正确的结果,但是用idhttp 的post方法却得不到,我的方法是这样的temp:=TIdMultiPartFormDataStream.Create;
temp.AddFormField('param1','02');
temp.AddFormField(param2,'12345');
idhttp1.post(url,temp)

php的页面源码如下,
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; />
<title>查询系统</title>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../style/main.css&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function checkme() {
hphm = document.frm.param1.value;
if(hphm==&quot;&quot;){
alert(&quot;你必须输入你查询的参数1!&quot;);
document.frmVehicle.hphm.focus();
return false;
}

var reMark = /^[A-Za-z0-9]{2}/d{3}$/;
if(!reMark.test(hphm)){
alert(&quot;您输入的参数不符合要求!&quot;);
document.frm.param1.focus();
return false;
}
document.frm.param1.value = document.frm.param1.value.toUpperCase();
}
//-->
</script>
</head>

<body>
<form action=&quot;query.php&quot; method=&quot;post&quot; name=&quot;frm&quot; onSubmit=&quot;return checkme()&quot;>
<table width=&quot;100%&quot; height=&quot;100%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>


<td width=&quot;15&quot;><input name=&quot;param1&quot; type=&quot;text&quot; id=&quot;param1&quot; size=&quot;12&quot; value=&quot;&quot; /></td>
<td height=&quot;40&quot;> <input name=&quot;param2&quot; type=&quot;text&quot; id=&quot;param2&quot; size=&quot;12&quot; value=&quot;&quot; /></td>
</tr>

</table></td>
</tr>
</table></form>
</body>
</html>
 
URL:=query.php?param1=regspy&amp;param2=幻芯
 

Similar threads

I
回复
0
查看
733
import
I
I
回复
0
查看
623
import
I
I
回复
0
查看
560
import
I
I
回复
0
查看
2K
import
I
I
回复
0
查看
2K
import
I
顶部