Page 1 of 1

integrating c++ with PHP...executing c++ file within PHP

Posted: Sun Jun 03, 2007 3:28 pm
by vineet7kumar
hi everyBuddy,

I am a complete newbie to PHP. I wrote my code in C++. I want to know whether there is a way to execute my c++ code from within my PHP code? if yes , HOW?

Or is there any other way to do this( maybe like putting in my c++ source code in the PHP code) ?

Thanx in advance...

Viny

Posted: Sun Jun 03, 2007 3:38 pm
by feyd
You can write you C++ into an extension for PHP. You can also call an executable from PHP.

Posted: Sun Jun 03, 2007 3:38 pm
by onion2k
What have you tried so far? There's no point covering ground you've already looked at yourself.

Posted: Sun Jun 03, 2007 3:39 pm
by maliskoleather
look into system();. using that, you can call/execute a script on the server.

can you guide me to the tutorial...to call the executable

Posted: Sun Jun 03, 2007 4:00 pm
by vineet7kumar
hey feyd, can [s]u[/s] you guide me to the tutorial where i can learn how to call an executable from PHP...

hey onion2k , i told [s]u[/s] you im a complete newbie ... wrote my c++ code ... now started PHP for a site i got to make..i need to call that code executable ( dont wanna implement my algorithm again in PHP... i dont even know that much PHP)....just read a few basics tutorials

[s]thanx[/s] thanks again,
viny
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.

Posted: Sun Jun 03, 2007 4:19 pm
by superdezign
Interesting... You know. PHP isn't that different from C++. If you have a steady understanding of C++, PHP should come naturally. It's just a matter of knowing the functions. There's a LOT of them.

As for executables, PHP.net - Program Execution Functions.

Posted: Mon Jun 04, 2007 12:48 am
by vineet7kumar
that sounds so good ... I mean if it's similar to C++ it will be good....

thanks,
viny