I have to create an online C compiler in php for my final year project. At first, I have to write a code in a php page and compile it. I've compiled with success a simple code including only printf commands (I've done it in two ways: with the "proc_open" function and the "shell_exec"). Now, for the next step I have to find how to execute a scanf command. When i try a scanf command, the browser stops responding. This is expected as the c program running in the background is waiting for an input to be given without letting me enter one. I can't find how to manage this issue.
Any ideas for the direction I should follow are welcome!
EDIT: It's done. In case someone needs something similar, I used proc_open's pipes[0] where stdin is stored to send my data.
Asked
Active
Viewed 733 times
2

georgia
- 45
- 1
- 7