1

I have a strange setup at the moment (busy with a migration)

I have a 4th Dimension application which calls php scripts (which is our soon to be, only application. Dropping 4D)

This script thats called from 4D needs to open a html file in the browser.

Is this possible?

Iv'e tried something along the lines of

header('Location: ./DischargeLetter.php?id='.urlencode($id));

This passes the html document (report) that I want to open along with the patient id.

calling it in the browser works (obviously hey), but how can I get php to open the browser or a tab and head to that page?

Tim Penner
  • 3,551
  • 21
  • 36
morne
  • 4,035
  • 9
  • 50
  • 96
  • I don't think you can control (open browser,or new tab on the browser) with php. Only server can execute your php code. This functionality belongs to the client. if your app is a desktop app you can open browser with a link to your file. if anyone knows otherwise, please comment – qwerty_igor Jun 10 '15 at 20:35

1 Answers1

1

From what I understand you have a command line script in php and you are trying to open a browser on the server?

If you are using the php like a command scripting language you can use http://php.net/manual/en/function.shell-exec.php to call other commands so you can call something like

shell_exec('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe $url');

Jeff
  • 4,622
  • 2
  • 27
  • 40
  • Yes that will work, but will open the window on the server side. I dont think you can probably open it on client side with php. Im using 4D now to do the same "shell_exec", but you can run it client side. Will just use AJAX to get the data to populate. Thanks for taking the time to help. – morne Jun 10 '15 at 21:21