首页 > 后端开发 > php教程 > PHP 调用IE执行程序

PHP 调用IE执行程序

WBOY
发布: 2016-07-28 08:26:36
原创
1155 人浏览过
<span><span><?php </span><span>/* just copied six lines below ... */</span><span>$Browser</span> = <span>new</span> COM(<span>'InternetExplorer.Application'</span>);
<span>$Browserhandle</span> = <span>$Browser</span>->HWND;
<span>$Browser</span>->Visible = <span>true</span>;
<span>$f1_url</span> = <span>"http://**.com/def.php"</span>;
<span>$Browser</span>->Navigate(<span>$f1_url</span>);
sleep(<span>5</span>);

<span>/* $allforms is NOT an array ... it is an iterator ... */</span><span>$allforms</span> = <span>$Browser</span>->Document->getElementsByTagName( <span>'form'</span> );

<span>/* current() is not implemented ... so we have to run a loop ... */</span><span>foreach</span>( <span>$allforms</span><span>as</span><span>$theform</span> ) {

    <span>/* i also copied these six lines and did some text replace work ... */</span><span>$theform</span>->id->focus();
    <span>$theform</span>->id->value = <span>"username"</span>;
    <span>$theform</span>->pwd->focus();
    <span>$theform</span>->pwd->value = <span>"password"</span>;
    <span>$theform</span>->action->focus();
    <span>$theform</span>->action->click();
    
}

<span>/* bye browser ... have a nice day ... */</span><span>$Browser</span>->Quit();</span></span>
登录后复制

以上就介绍了 PHP 调用IE执行程序,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板