I know you can do it with php, there are some relatively simple commands that can open, read, and write files. I, unfortunately, have no clue how to actually do this.
[NAG]Also note that this has been answered many times before, try searching… [/NAG]