Hello,
I am developing a web application, in which user uploads his C code or pastes his code in the textarea in the web page and submits it thereby. I have made use of processes and bidirectional pipes to compile and execute the program. I have used functions like proc_open, shell_exec to carry out compile and run code. Everything working fine till here. Now, the thing I want to achieve:
Suppose the running code is taking more than a certain amount of time to give the output(e.g infinite loop), then how can I terminate that running code after (say 1 sec) and detect that code's taking a longer time thqan 1 sec to execute?. ( I am using Windows XP, Apache, PHP(>5))
Also, what are the security issues involved in using pipes and file uploading if I use this application over a network for holding a programming contest