I want to change file (file.txt) located on my website.
I use AJAX command:
On space pressed --------> Send Text.text to url"url/send.php" (method Post,tag "savedata").
PHP file on the website:
<?php
header('Access-Control-Allow-Origin: *');
/* POST*/
$data = $_POST['data'];
file_put_contents("file.txt", $data);
?>
The content of the file.txt doesn't change.
It seems to me the Data is not transferring properly. What is wrong in the code?