hey guys...
i need some help here...i am trying to run an .exe program from my web page. however, it does not work as it should be. the program should generate some random number and write it to a txt file.
i do not know whether it execute the program or not, but it does not write to the txt file for sure since as i print out the file, it is not updated.
i use code below to execute my program in DOS and it works fine:
C:\Prog~1\02VALKEY.EXE /CC /R991LR1LJ1KSASMAS /T1212;
i think i got confused in the way i pass parameters to my exe program. i have couple of methods below with no luck
$RegKey = "991LR1LJ1KSASMAS";
$runprogram = "\"http://test.mysite.com/webclick/02VALKEY\" \"/CC /R$RegKey /T1212\"";
OR
$runprogram = "'02VALKEY.EXE' /CC /R$RegKey /T1212";
OR
$runprogram = "start \"http:\"\"//\"test.mysite.com\"/\"webclick\"/\"02VALKEY.EXE \"/\"CC \"/\"R991LR1LJ1KSASMAS \"/\"T1212\"";
OR
$runprogram = "start \"/files/02VALKEY.EXE\" /CC \" \"R$RegKey\" \"T1212\"";
OR
$runprogram = "start '02VALKEY.EXE /CC /R' .$RegKey. ' /T1212;'";
OR
$runprogram = "start \"http:\"\"//\"test.mysite.com/webclick/02VALKEY.EXE\" \"/CC /R991LR1LJ1KSASMAS /T1212;\"";
OR
$runprogram = "start /D \"/var/www/test/webclick/\" /B 02VALKEY.EXE \"/CC \" \"/R991LR1LJ1KSASMAS \" \"/T1212;\"";
exec($runprogram);
can someone help me to make it works? i have looked and searched Manual, this and other forums, but there is no explanation about the 'correct method' to pass parameters.
i will also thankful if someone can point me a link where i can get some kind of tutorial to work with exec() parameters.
one other thing, how can i print error (if there is any) to see whether my code works or not? since i do not know whether there is error or not in my code so far.
thanks in advance for your time and help. really appreciate it.