running C file from PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gghaleb1
Forum Newbie
Posts: 2
Joined: Thu Feb 06, 2003 4:05 am

running C file from PHP

Post by gghaleb1 »

hi all,

Does anyone know how i can use php to start executing a c file (e.g. test.c) and return a value to PHP to be stored in a variable?

if that is not possible then can i do the same thing with a compiled c program (e.g. test.exe)?

can anyone give me an example code, becasue i am not an expert at PHP!
Thanks :D

gghaleb1
ReDucTor
Forum Commoner
Posts: 90
Joined: Thu Aug 15, 2002 6:13 am

Post by ReDucTor »

it needs to be compiled first. then just use the shell/system functions..
gghaleb1
Forum Newbie
Posts: 2
Joined: Thu Feb 06, 2003 4:05 am

Post by gghaleb1 »

ok, can you give me an example code. cos i read about system() function but still don't know how to use it.
After running the compiled program, is there a way to return the results from the compiled program to php.
ReDucTor
Forum Commoner
Posts: 90
Joined: Thu Aug 15, 2002 6:13 am

Post by ReDucTor »

see

http://php.net/system

or search google.com
Post Reply