View Single Post

  #3 (permalink)  
Old 10-24-2006
bob.chatman@gmail.com
 
Posts: n/a
Default Re: using php to open a broswer?

It might not be possible directly through PHP, but it is possible
indirectly.

<?

function openwindow($url, $title = "MyWindow", $width = 400, $height =
200)
{
?><script language="javascript" type="text/javascript">
window.open('<?= $url ?>','<?= title ?>','width=<?= $width
?>,height=<?= $height ?>);
</script>
<?
exit;
}
?>

PHP May be server side, but it writes all the content that is seen by
the user, so it is in effect, controlling the js.

Rik wrote:
> Sunusi Ringim wrote:
> > hi
> > how can u i use php to open a browser and display somthing? am
> > developing an application i want to uweb GUI. please help.

>
> Indeed. If a browser is installed on the server, you can simply open a
> browser window with exec(). Check the command line options of that browser
> to open a certain page. Given enough rights, PHP will happily open a
> browserwindow for you on the server.
>
> If you mean that a window has to be opened by a remote client on a request:
> not possible with PHP.
>
> --
> Grtz,
>
> Rik Wasmus


Reply With Quote