PHP 呼叫IE執行程式

WBOY
發布: 2016-07-28 08:26:36
原創
1151 人瀏覽過
<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
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板