to write on the server you need code to run at the server.
then you can call the code via ajax or form post.
server programming is off-topic here. if you have decided your server programming platform e.g. asp.net, php, java ee or nodejs then ask in the forum for your server programming platform if you need more help.
Visual C++ MVP