RapidPHP Posted March 25, 2010 Share Posted March 25, 2010 I wondered if anyone could help shed some light on something I am trying to achieve, I will try and explain as clearly as I can. Basically using PHP I would like to be able to compile an exe (windows executable) programmatically on the server in real-time, I know this is possible, but at the moment am not quite sure how. To explain; basically we will have a file on our server, and when the customer has made a successful payment online, using PHP we would programmatically add a unique code to this file and then compile it to produce a unique executable (something.exe) in realtime for them to download and install on a Windows PC. I hope this makes sense, can anyone help? Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 25, 2010 Share Posted March 25, 2010 http://php.net/manual/en/language.operators.execution.php Quote Link to comment Share on other sites More sharing options...
RapidPHP Posted March 26, 2010 Author Share Posted March 26, 2010 Thank you for your help. The part I am struggling with is: I need to embed a pre-created text file (customer.txt from the server) into an executable, this executable when ran on a Windows PC must then place the embedded text file into a specified location e.g. "C\Program Files\Something\customer.txt" So my problems are: 1) To embed a text file into an executable. (programmatically in real-time on the server) and 2) I need to program the exe to place this file somewhere when ran. Can anyone help in this area? Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 26, 2010 Share Posted March 26, 2010 Neither of these is in scope of PHP. 1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation. 2) This is done by your program, so PHP has nothing to do with it. Quote Link to comment Share on other sites More sharing options...
Wolphie Posted March 26, 2010 Share Posted March 26, 2010 Neither of these is in scope of PHP. 1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation. 2) This is done by your program, so PHP has nothing to do with it. Couldn't PHP automate the process a bit though? For example, if you had a compiler locally, you could use PHP to initiate the compiler and send the executable to the browser for download? Could be wrong, though. Quote Link to comment Share on other sites More sharing options...
trq Posted March 26, 2010 Share Posted March 26, 2010 Neither of these is in scope of PHP. 1) PHP can fwrite a file for you, but it's your compiling environment that should grab it and use it for compilation. 2) This is done by your program, so PHP has nothing to do with it. Couldn't PHP automate the process a bit though? For example, if you had a compiler locally, you could use PHP to initiate the compiler and send the executable to the browser for download? Could be wrong, though. That is precisly what Mchl pointed out, the rest of the OP's question however is not at all php related. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.