Connecting Tech Pros Worldwide Forums | Help | Site Map

execute php from c++

Newbie
 
Join Date: Jul 2008
Posts: 24
#1: Jul 6 '09
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:\program 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

Newbie
 
Join Date: Jul 2008
Posts: 24
#2: Jul 6 '09

re: execute php from c++


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
Needs Regular Fix
 
Join Date: Jul 2008
Posts: 385
#3: Jul 12 '09

re: execute php from c++


"\"c:\pro...exe\" ...
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,188
#4: Jul 12 '09

re: execute php from c++


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