<?php
  $saved = false;
  //print_r($_POST); 
  if (isset($_POST["save"])){
    
    // save the textarea to the file
    // make sure to set file permissions to 777
    $file = fopen("data/about.html", "w") or die("check permisssions");
    
    // remove slashes that were added when post occurred
    fwrite($file, stripslashes($_POST["content"]));
    
    fclose($file);
    
    $saved = true;
  } 
  
?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>CMS</title>
  
    <style>
      textarea{
        width : 500px;
        height : 400px; 
        resize : none;
      }
      
    </style>
  </head>
  <body>
    <h1>CMS</h1>
    <?php
    
  if ($saved){
    echo "Your file was saved...";
  }
  
    ?>
    <form method="post" action="cmsAbout.php">
      <textarea id="content" name="content"><?php
        $file =  file_get_contents("data/about.html");
        echo $file;
      ?></textarea>
      <input type="submit" name="save" value="save" />
    </form>
   
  </body>
  
</html>