Forum Moderators: phranque
I am developing a site in HTML that has an "input parameters" page. These are currently a <form> in HTML.
What i want to do is to take these inputs and use them to run a .exe file that we have developed in C++. Normally this runs of a data file,..such as "paramater.dat".
So what i think i need to do is:
#use a cgi script to take the inputs (checked with JavaScript) and write them into a temporary file.
#use the CGI script to run the .exe telling it to look in the temporary file fo its inputs
#run the program
#take the output file and email it to the email address supplied by the online user.
Okay, so i think if i learn php i will be able to do it with that. From what i have gathered cgi's can be written in lots of languages,..perl php etc, but i think php is best for this?!
Problems arise if i start to think about more than one user using it at a time, as i must have different temporary files otherwise one user may overwrite another...
Am i on the right lines with php,..only i can't seem to find anything on the web, though i know its been done before!
Any advice?!
Thanks,
Dunc
You could use anything (including PHP) to write a file to the hard drive and execute another local program. There are security concerns while doing this, but any language can do it really. As you mentioned, there are also multi-user concerns, but those can be overcome with the use of a lockfile or a background daemon (that handles multiple requests) or something similar.
One question: Would you be open to rewriting the functionality of the C++ application in a language such as PHP? If so, this might be a better method than the way you are proposing.