integrating c++ with PHP...executing c++ file within 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
vineet7kumar
Forum Newbie
Posts: 6
Joined: Sun Jun 03, 2007 3:10 pm

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

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You can write you C++ into an extension for PHP. You can also call an executable from PHP.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

What have you tried so far? There's no point covering ground you've already looked at yourself.
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

look into system();. using that, you can call/execute a script on the server.
vineet7kumar
Forum Newbie
Posts: 6
Joined: Sun Jun 03, 2007 3:10 pm

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

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
vineet7kumar
Forum Newbie
Posts: 6
Joined: Sun Jun 03, 2007 3:10 pm

Post by vineet7kumar »

that sounds so good ... I mean if it's similar to C++ it will be good....

thanks,
viny
Post Reply