I am trying to open a cash drawer from a Linux-share hosted PHP page. The cash drawer is a MMF POS connected through a POSX USB adapter (no receipt printer to trigger the drawer). I can run a batch file to trigger the cash drawer to open. I have not found a way to execute the .bat file from a PHP page (preferably a button on my page).
Batch file open.bat
Copy /b open.txt COM4
open.txt (unicode)
瀛─ഥ
I copied the open.bat and open .txt to c:\opendrawer of the computer connected to the POSX. I have tried creating a opendrawer.php page with the following code:
<?php system('cmd.exe /c C:\opendrawer\open.bat'); ?>
It did not trigger the cash drawer to open. No error message either. I also tried:
exec('start c:\opendrawer\open.bat');
I also know that from CMD the following command will open the register. Is there a way to setup a button on my PHP page to execute it.
echo ^G>COM4
Does anyone have a suggestion on how to get this cash drawer to open with a button click on a PHP page? Many thanks.