Re: Run Executive from PHP on Windows
| From: | André Jansen | Date: | Fri, 13 Aug 2004 04:07:37 +0000 |
| Subject: | Re: Run Executive from PHP on Windows | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4961@lists.php.net to get a copy of this message | ||
Hi,
On 10 Aug 2004 at 21:36, difenza2003@libero.it wrote:
> Hi all i try to develop a little Gui Application to create html document..
> I want to launch the browser with exec() function from PHP-Gtk but i
> don't have any result.
>
> $button = &new GTkButton('view');
> $button->connect('clicked','launch_browser');
>
> function launch_browser() {
> $path = "C:\\Program\\Internet Explorer\\iexplore.exe";
> exec($path);
> }
> On the CMD.exe console i read unkown command C:\Program\Internet
> Explorer\iexplore.exe blah blah blah I want to locate the browser on
> localhost to particular site from example:
> http://localhost/example/view.php What i do ?
You could use the following:
function launch($url)
{
// if required, insert code for checking the validity of $url
exec('start '.$url);
}
In windows, this will launch the system default browser with the url
supplied.
IMHO, this method is to be preferred over explicitly launching internet
explorer. I have set up windows to use Firefox as my default browser, and
I would be mightily p****d off if some application insisted on launching
IE instead (like the windows htmlhelp program does).
Another nice thing is that you can use this same function to send an e-
mail. If you set $url to 'mailto:example@example.com' it will fire up
your default e-mail program which will create a new blank e-mail to the
address supplied.
HTH,
--
André
============================================================
I'm out of my mind, but feel free to leave a message...