execute php from c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ragonz
    New Member
    • Jul 2008
    • 24

    execute php from c++

    how to execute php file from c++ line? i've tried to use "system()" code, but showed no result.

    from cmd line the command look like this

    c:\program files\xampp\php \php4\php.exe c:\upload.php

    it works in cmd, n i tried to put it into c++ with system() syntax, it looks like this

    system("c:\prog ram files\xampp\php \php4\php.exe c:\upload.php")

    i compile it, n it succeded, but when i tried to run the .exe file, it shows no result. any suggestion?

    regards
  • ragonz
    New Member
    • Jul 2008
    • 24

    #2
    i figured something, the command in cmd line should be like this

    "c:\program files\xampp\php \php4\php.exe" c:\upload.php

    NOT

    c:\program files\xampp\php \php4\php.exe c:\upload.php

    with quote in the path of php.exe, now the problem is, how to put it in c++ line?
    thx

    Comment

    • newb16
      Contributor
      • Jul 2008
      • 687

      #3
      "\"c:\pro...exe \" ...

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Not to mention in the C++ code every \ in the string should be \\

        Comment

        Working...