If you create an html form, and use action="<? PHP_SELF; ?>"
you can use the script below to save the content of your input to a text, or other file:
if ($input != "")
{
$filename = "./dir/filename.txt";
$fp = fopen($filename, "w") or die("Couldn't open $filename");
fwrite ($fp, $input );
fclose ($fp);
}
Obviously the $input being:
$input = $HTTP_GET_VARS["input"];
collecting the info from your html form.
Hope that helps.
Also, you may need to check your server, and ensure you have permisions set to allow you to create a new file, overwrite etc.