I have a C simulation for which I'm creating a graphical web interface. I used HTML with ajax to call PHP, which in turn calls the shell to run the simulation. The output is then passed back to the webpage.
The script generates an output file (with a link outputted to the webpage) as well as a graph (using a call to gnu plot and referencing the output file). The webpage also allows the user to upload an input file which is used in the C simulation. All of these files are user specific.
If there is only one user on the webpage at a time, there isn't any problem. However, if 5 people want to run the simulation at the same time, the user-specific files (output, graph, input) would all be getting overwritten and messed up.
I don't have any MySQL experience, and I also don't plan on saving the outputs or inputs for a given user (user can download them if he/she wishes), so I was hoping there might be a rather simple solution like, for example, generating a temporary directory on the server with some sort of identifying tag in the name based on the user's IP address or something. This folder could then be removed some number of minutes after the simulation runs. Anyone have any ideas about something like that?
Or will I have to resort to MySQL?
Edit: It would also be okay to have something like allowing a maximum of 5 users running at the same time and then create a queue for additional users, but that might be even more difficult.
Thanks, Josh