User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,369 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,768 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1466 | Replies: 3
Reply
Join Date: Dec 2006
Posts: 2
Reputation: jethroalias97 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jethroalias97 jethroalias97 is offline Offline
Newbie Poster

executing c++ code from php

  #1  
Dec 15th, 2006
hi, i'm trying to execute some c++ code from the php script in my webpage, but its not working. the best i could find was the php code below.

  1. $output = shell_exec('ls -lart program.exe');
  2. echo "<pre>$output</pre>";

here is the code of program.exe (codewarrior created program.exe from this code)

  1. using namespace std;
  2. int main()
  3. {
  4. return 7;
  5. }

when i run this the screen just says some data, like date and my host server and the program, but does not exectute the program.

i was trying to get it such that when i run the page this php script is on it says 7. thanks.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: executing c++ code from php

  #2  
Dec 16th, 2006
Are you sure your permissions allow remote execution? It's generally a Bad Idea (tm).
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote  
Join Date: Dec 2006
Posts: 2
Reputation: jethroalias97 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jethroalias97 jethroalias97 is offline Offline
Newbie Poster

Re: executing c++ code from php

  #3  
Dec 16th, 2006
no, i suppose i don't have permision, do you know if there is anyway to execute java code from a javascript or some other scripting language, i've been searching all over the interenet, but nothing seems to allow me to call java functions from the site's code.

Is this even possible?
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: executing c++ code from php

  #4  
Dec 17th, 2006
Your PHP code would simply output the HTML code necessary to load the Java Applet.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 12:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC