yeah, you're pretty much down to php and ajax or something similar - javascript can't really write to files (well, if you're IE only and you just want to write a file to the user's machine and they give you permission to do so, you can but really from what it sounds like that isn't the case).
I made a google map that saves clicked locations to the database - you can see it
here. That's kind of a different thing, but there is some overlap. I followed the tutorial
here for setting up the php side, which I had no idea about and still only really vaguely understand how it works... but hey - the important thing is that it works, right?