Re: Calling IE for a form POST
| From: | Jon | Date: | Fri, 22 Jul 2005 21:28:21 +0000 |
| Subject: | Re: Calling IE for a form POST | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6094@lists.php.net to get a copy of this message | ||
I agree that libcURL has been very handy for me. The caveat that I ran into
is a "search.do" that passe me to page.jsp that would in turn route to a
different page after a lot of javascript. I don't have any idea how to make
php calculate the javasript so I had to come up with another solution. If
someone can figure out a way to get php to calculate javascript then I could
use libcURL for this project too.
So now.... here is the com code
$ieapp = new COM("InternetExplorer.Application");
$ieapp->Visible = false;
$ieapp->Navigate(http://www.php.net);
//wait for page to load
$working = $ieapp->ReadyState;
While ($working != 4){
$working = $ieapp->ReadyState;
Sleep(2);
}
//fill in the form data
$ieapp->document->Forms(0)->pattern->Value = "com";
$ieapp->document->Forms(0)->show->Value = "quickref";
//and submit
$ieapp->document->Forms(0)->submit();
//wait for page to load
$working = $ieapp->ReadyState;
While ($working != 4){
$working = $ieapp->ReadyState;
Sleep(2);
}
//wait for good measure just to be sure page is totally loaded
Sleep(3);
$ieapp->Visible = true;
//clear the com
unset($ieapp);
Thanks all
Jon