redhatping 发表于 2011-3-4 10:16:18

Autoit提交网页表单的时候无法提交

环境:win7 , IE9浏览器

网页源代码:
<body onload="javascript:document.form1.UNAME.focus();">
<div align="center">
<form name="form1" method="post" action="logincheck.php" autocomplete="off" onsubmit="return CheckForm();">
<div class="login_div" align="center">
<b>用户名</b> <input type="text" class="text" name="UNAME" maxlength="20" onmouseover="this.focus()" onfocus="this.select()" value="" />&nbsp;&nbsp;
<b>密码</b> <input type="password" class="text" name="PASSWORD" onmouseover="this.focus()" onfocus="this.select()" value="" />&nbsp;&nbsp;
<input type="submit" class="submit" value="登 录" />
</div>
<br>
<br>

</form>



AUTOIT源代码:

#include <IE.AU3>
$oIE = _IECreate("http://192.168.1.132:101/")
$Forminfo = _IEFormGetObjByName($oIE,"form1")
$oQuery = _IEFormElementGetObjByName($Forminfo,"UNAME")
_IEFormElementSetValue($oQuery,"lixiang")
$oQuery=_IEFormElementGetObjByName($Forminfo,"PASSWORD")
_IEFormElementSetValue($oQuery,"111111li")

$oQuery=_IEFormElementGetObjByName($Forminfo,"submit")
_IEAction($oQuery,"click")

smartzbs 发表于 2011-3-4 10:39:36

#include <IE.au3>
$oIE = _IECreate ("http://192.168.1.132:101/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
_IEFormElementSetValue ($oQuery, "lixiang")
$oQuery = _IEFormElementGetCollection ($oForm, 1)
_IEFormElementSetValue ($oQuery, "111111li")
_IEFormSubmit ($oForm)

redhatping 发表于 2011-3-4 11:08:41

感谢楼上, 但是还是无法提交。

smartzbs 发表于 2011-3-4 11:50:29

已经提交了,提交页面是:logincheck.php
你要看你的logincheck.php页面有无错误

redhatping 发表于 2011-3-4 15:56:06

不行啊, 我不用AUTOIT,点登录,都是正常的啊
页: [1]
查看完整版本: Autoit提交网页表单的时候无法提交