Workshop
The workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.
Quiz
1: | Which function is used to open a pipe to a process? |
2: | How can you read data from a process after you have opened a connection? What about writing data? |
3: | How can you escape user input to make it a little safer before passing it to a shell command? |
Answers
A1: | popen() |
A2: | You can read and write to and from a process just as you can with an open file, namely with feof() and fgets() for reading and fputs() for writing. |
A3: | You can use the escapeshellcmd() or escapeshellarg() functions, if you must accept user input. |