You'll probably just want to write a frontend to a compiler like MinGW in something like PHP.
Look into the exec() function in PHP. You could take the input from a text field, write it to a file with fopen() and fwrite(), then run system("gcc filename.c -o filename.exe") to compile the code. You could then provide a link to the output executable.
Of course, this is only a very rough guide!