Remove special characters from user input

On creation of each page, remove any special characters from the items
in the $_REQUEST array. Special characters are those which are used to
form the data file. If a user was to use these, it could cause
potential problems. Also changes straight apostrophe to curly
apostrophe, as names with apostrophes will cause issues, and trims
initial and final whitespace.
Changed fopen() mode to a+ for write access

It turns out that using the c+ mode causes the file size to double
after every write, even though the contents of the file hasn’t doubled
(why? I don’t know). Whatever the reason, the a+ mode appears to work,
so I’ve switched to using that.