Using php to create or touch a file, first checks to see if it already exists.

CODE:
  1. <?php
  2. //set the filename or passed from form argument
  3. $filename = "/path/filenane.ext";
  4. //does the file exist?
  5. if (!file_exists($filename)) {
  6. //create the filename
  7.         touch($filename);
  8. //set permissions
  9.         chmod($filename,666);
  10. }
  11. ?>