Run a .exe with input parameters from PHP web page

后端 未结 1 2002
遇见更好的自我
遇见更好的自我 2021-01-14 03:28

I\'m currently trying to get an executable to run from within a PHP web page (currently using exec()). The program takes two arguments when run from the command

1条回答
  •  迷失自我
    2021-01-14 04:12

    basic PHP syntax error: you're using the wrong quotes. Use double-quotes instead.

    exec("C:\wamp\www\web_dev\test\my_program.exe $argument");
         ^---                                              ^---
    

    single quotes (') do NOT interpolate variables into the string. You're trying to pass a literal $, a, etc... as an argument, not the value of that variable.

    0 讨论(0)
提交回复
热议问题