Guest geantbrun Posted April 19, 2009 Report Share Posted April 19, 2009 Hi guys, I'm relatively new to the domain of web programming and I need your opinion about the design of my website (server platform is Linux). The target audience is financial institutions, not too much traffic on the site but each client needs from time to time heavy calculations. Typically, the institution enters some parameters and the site would return results later (graphs, pdf file). 1 - I'm considering Joomla for the website design with some forms component to get user parameters filled in mysql tables. 2 - in some ways, I have to launch a program in the background (don't know how) that will do the number crunching (see below). 3 - the routine is started (but not finished) and the control returns to the the website. A message like this shows: "Thank you, you will receive an email when results are ready". The step 2 could be done by a C++ program (actually, I already coded the heavy loops in this language) but I was thinking of PHP as a wrapper of the main routine in C. In PHP, it's easy to read parameters from mysql tables, create graphs (open flash charts?) and send email confirmation at the end. My questions are: - is this design good? Am I missing something? - is it a good idea to wrap the C routine with PHP? how to launch the PHP program in the background? - how to pass parameters from PHP to C++? Instead of having a neat solution to pass parameters, would it be easier to dump data in text files for the communication between PHP and C++? Data is not big here (and it's equally true for the input and the output) and time to read and write files is not important compared to the time for calculations itself. Any hint would be greatly appreciated, Patrick Quote Link to comment Share on other sites More sharing options...
monkeysaurus Posted April 20, 2009 Report Share Posted April 20, 2009 (edited) Hi Patrick, The basic idea seems sound. In order to run an external program from PHP, you should look into the system, exec, and passthru functions. These will all do what you need to do. Edited April 20, 2009 by monkeysaurus Quote Link to comment Share on other sites More sharing options...
LSW Posted April 20, 2009 Report Share Posted April 20, 2009 I don't see why you would want a separate program. You can build it right into the web page and consider Ajax, that way it can do the number crunching at the same time the people are typing it in so they have an immediate answer when they are finished. It does the talking with the server continually while it is being used, so no delay waiting for the answer. 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.
Note: Your post will require moderator approval before it will be visible.