Hi...
I'm currently programming a cash register system in php. I'm having difficulty in executing a .exe file which i have created using VB6 to open the cash drawer.
However, when i execute it using the exec('c:\creg.exe'), it will not open the drawer. When i check the Windows Task Manager, i can see that the program is running by the IUSR_XXXXX but it does not open the cash drawer... it seem like it is running in the background.
I assure you that the .exe program works fine when i execute it directly by double clicking it. But thru php, it won't work.
Anyone can help?
Thanks,
munhing
How to open .exe file in php and not running in the backgrou
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
typically, you don't open an .exe in php, unless it's to send it to the user. I'm going to guess this is being used through an ActiveX, in which case, it's already loaded on the user's machine. Merely running an .exe from php will only interact with the server itself, not affecting anything on a client (most often). Maybe more explaination is in order?
In the setup that I'm guessing he is using there would be no Client. The Client and Host are the same computer. Basically loading a page via Localhost. As far as connecting to an exe file goes I'm not sure. I know there is a way to send commands to an exe file but I'm not sure how to do it.feyd wrote:typically, you don't open an .exe in php, unless it's to send it to the user. I'm going to guess this is being used through an ActiveX, in which case, it's already loaded on the user's machine. Merely running an .exe from php will only interact with the server itself, not affecting anything on a client (most often). Maybe more explaination is in order?
It might be easyer to recreate your VB6 file into a plain C command prompt. Even better yet you may be able to open the cash register from CMD(depending on your your shop's computer is setup).
Thanks for the replies.
Basically i'm running all this locally in my localhost...
I've also created another program in VB6 called open.exe. This program will execute the creg.exe.
VB code for this is
I'm desperate to find a solution for this... There is no error displayed as i run the php script.
Any other solutions?
Basically i'm running all this locally in my localhost...
I've also created another program in VB6 called open.exe. This program will execute the creg.exe.
VB code for this is
Then in php, i code this:Private Sub Form_Load()
Shell "c:\creg.exe"
End
End Sub
When i run it, it doesn't work. Still in the Windows Task Manager, i can see that the program is running by the IUSR_XXXXX but it does not open the cash drawer... it still runs in the background<? exec('c:\open.exe'); ?>
I'm desperate to find a solution for this... There is no error displayed as i run the php script.
Any other solutions?