<?php
  
  $file =fopen("data/test.html", "w");//"w" stands for write 
  //if open file and its not there (in the RAM - error) we tell it to die
  if (!$file){
    die("oh no check permissions");
    //if you see this change permissions on data/test.html to 777
  }
  
  fwrite($file, "this is really cool");
  fclose($file);
  echo "all done";