The purpose of these two scripts, are to act as an auto-save function for blog posts. It can of course the re-purposed for anything else but this is what it was originally intended for.
How it Works
If they do exist, the PHP script will run an update, if they do not exist, PHP will insert those values into the database.
Ensure that 'var url' is = to the name of your php script which captures the input. In this case, it's simply 'autosave.php'.
var httpc = new XMLHttpRequest(); // simplified for clarity var url = "autosave.php"; // PHP script that you'll be passing data to httpc.open("POST", url, true); // sending as POST
var httpc = new XMLHttpRequest(); // simplified for clarity var url = "path/to/folder/autosave.php"; // PHP script that you'll be passing data to httpc.open("POST", url, true); // sending as POST