欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP 调用IE执行程序

程序员文章站 2022-06-15 16:20:11
...
/* just copied six lines below ... */$Browser = new COM('InternetExplorer.Application');
$Browserhandle = $Browser->HWND;
$Browser->Visible = true;
$f1_url = "http://**.com/def.php";
$Browser->Navigate($f1_url);
sleep(5);

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

/* current() is not implemented ... so we have to run a loop ... */foreach( $allformsas$theform ) {

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

/* bye browser ... have a nice day ... */$Browser->Quit();

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