我尝试自动登录的外部网站有以下 HTML 表单(包括 JavaScript)。
<form name="autologin" method="POST" action="https://post.website.com"></form>
<script language="JavaScript">
document.autologin.submit();
</script>
带输入
<input type="hidden" name="Z" value="0,0">
<input style="font-size: 11px;" type="submit" value="Logon">
如果第二个输入缺少名称,如何使用 PHP 以编程方式提交此表单?
到目前为止我的代码:
$url = 'https://post.website.com';
$request = new HTTP_REQUEST2($url, HTTP_REQUEST2::METHOD_POST);
$mainPageRequest = array(
'Z' => '0,0',
'' => 'Logon' // <---- What goes here since it's missing a name?
);
$request->addPostParameter($mainPageRequest);
$request->send();