Saving to server

Hi, I am new to the community, and to java script.

I am in no way a professional, but I do love coding.

I have been looking around to see if i could find anything that could do what i want to do as described in the above title, but I have failed to find anything.

The saving function that i could find, seems to want to force download to the client side, but i want something that can save to the server side, i will figure out the SQL for it later, but for now, i need to save to the server first.

Any ideas? anywhere where i can look?

PS: I am using the playground.

Hi. You need server side scenario. There start point saving-a-text-file-on-server-using-javascript
And for crossorigin domains you need header(‘Access-Control-Allow-Origin: *’);

<?php header('Access-Control-Allow-Origin: *'); if(!empty($_POST['data'])) { $data = $_POST['data']; $fname = "config.json"; $file = fopen($_POST['url'] . $fname, 'w'); fwrite($file, $data); fclose($file); } ?>

Thank you for this. I am still stuck, due to a lack of experience in php, but I just need to do some more research, but this does throw me into the right direction, thank you very much!