Page 2 of 2

Posted: Wed Jun 21, 2006 12:52 am
by RobertGonzalez
Are you looping through a filesystem write procedure? Seems resource intensive...

Try this in your code.

Code: Select all

<?php
// open the file or kill the script and show error
$dude = fopen($fileName, 'w') or die("can't open file");

// create what to write
$write = $_POST['name'] . $_POST['email'] . $_POST['article'];

// Write to the file with fwrite now
$numBytes = fwrite($dude, $write);

// For some reason, write again, but without all the parameters
// This assumes that you are in a loop and that you have a 
// series of files named article{somenumber}.txt
fwrite("article/article" . [$i] . ".txt");

// Close the file handle
fclose($dude);
?>