How to create a file using PHP
TAGS: PHP, Textfile

if (isset($_POST['doit']))  { 
$filename = $_POST['filename']; 
$stien = getcwd(); 
  $file = fopen($stien . "/" . $filename, 'w'); 
echo "Finished"; exit(); 

<TD>Give your file a name, <BR/>remember extension (.txt)</TD> 
<TD><INPUT TYPE='text' NAME='filename'></TD> 
<TD>Click here to create file: </TD> 
<TD><INPUT TYPE='submit' NAME='doit' VALUE='Create textfile'></TD> 

This is a very simple example on how to create an empty textfile. .. or any flatfile. Simply put the above code into a .php file and call it from you webserver.