Xeoncross Posted May 26, 2008 Share Posted May 26, 2008 Well, I wanted to create a COM object from within PHP - but I am having a little trouble. I can launch IE from the COM but I can't launch Firefox or Opera. <?php //Works $browser = new COM("InternetExplorer.Application") or die("Unable to start IE"); $browser->Navigate('http://google.com'); $handle = $browser->HWND; $browser->Quit(); //Does NOT work $browser = new COM("Firefox.Application") or die("Unable to start FF"); $browser->Navigate('http://google.com'); $browser->Quit(); ?> Now, I did research on Mozilla's site and I found a list of CMD line functions you can pass Firefox. So I built this working code: <?php system('"C:\Program Files\Mozilla Firefox\firefox.exe" http://google.com'); ?> However, I want a handle I can use to work with this new FF process - I don't just want to start it. So can anyone help with this? http://developer.mozilla.org/en/docs/Command_Line_Options#Windows http://us.php.net/features.commandline http://us3.php.net/manual/en/function.system.php http://kb.mozillazine.org/Command_line_arguments Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/ Share on other sites More sharing options...
trq Posted May 26, 2008 Share Posted May 26, 2008 Neither FF or Opera provide a com interface, so your first option is never going to work. As for your second, what exactly do you plan on doing with this handle? Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/#findComment-550438 Share on other sites More sharing options...
Barand Posted May 26, 2008 Share Posted May 26, 2008 I may have a stunted imagination but I cannot see the point in opening a browser on the server. It's unlikely that a browser is installed there anyway. I'm curious. Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/#findComment-550461 Share on other sites More sharing options...
Xeoncross Posted May 27, 2008 Author Share Posted May 27, 2008 Neither FF or Opera provide a com interface, so your first option is never going to work. Darn. Well, then it looks like I am stuck with *cringe* IE... Oh, and I want to know if I can do things like access parts of the browser from the command line. But I get what you are saying Barand. Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/#findComment-550827 Share on other sites More sharing options...
trq Posted May 27, 2008 Share Posted May 27, 2008 You do realise that accessing anything via COM only accesses COM on the server not the client? If you want to interact with a clients browser your best option is Javscript because it actually runs on the client. Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/#findComment-550830 Share on other sites More sharing options...
Xeoncross Posted May 31, 2008 Author Share Posted May 31, 2008 You do realise that accessing anything via COM only accesses COM on the server not the client? If you want to interact with a clients browser your best option is Javscript because it actually runs on the client. lol, yep I'm not that big of a noob. This is strictly server-side interaction from PHP to *nix Link to comment https://forums.phpfreaks.com/topic/107341-how-can-i-lanuch-firefox-from-within-php/#findComment-553950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.