Quantcast

Jump to content

» «
Photo

Auto flatfile creator

No replies to this topic
Snow Racer
  • Snow Racer

    Member Title

  • Feroci
  • Joined: 23 Mar 2003
  • Norway

#1

Posted 16 May 2005 - 04:17 PM Edited by Snow Racer, 16 May 2005 - 04:30 PM.

I have problem with witting a script and im tired now so maybe you ca help...

I need that the script checked for the file using "file_exist" then echo yes if exist.. if no... create flatfie based on teh filename
::edit
next time I will wait 5 minutes before I make teh topic...

CODE
<?php
$filename = 'filea.txt';

if (file_exists($filename)) {
  echo"exist";
} else {

$entry_line = "\n";
   $fp = fopen($filename, "a");
   fputs($fp, $entry_line);
   fclose($fp);
}
?>


<?3




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users