I have made a very simple editable html page using content editable But I'm new to using php and want to use it so save the changes to the HTML page. and some way of keeping a history of the page,
I don't even know where to start, But I'm thinking of using echo at the bottom of the page
"last updated : $TIMESTAMP"
and also writing it to some sort of log file
Apologies but it's not an HTML file i'm trying to save it a PHP file but I'm trying to use the below php function that will be called by an html button, to save the current webpage as a new file, but it doesn't even create the new file?
<?php
$SERVER = basename(__FILE__, '.php');
$FILENAME = "$SERVER.php";
function save(){
$file = fopen('test.php','w');
fwrite($file,file_get_contents($FILENAME));
fclose($file);
}
?>
<button onclick="save()">save</button>