Page 2 of 2

Re: Errors in File Handling program

Posted: Mon Aug 24, 2009 8:54 am
by jackpf
I don't know...your code looks like a big jumble tbh.

Find wherever you're writing to the file, and either put that in the loop, or concatenate a string to write to the file.

Re: Errors in File Handling program

Posted: Mon Aug 24, 2009 8:56 am
by phphunger
jackpf thanks for ur support, actually i missed the append mode in the fileWrite(), now my task is fulfilled, thanks mate

Code: Select all

function fileWrite($export)
{
            
            $myFile = "phonedetails.txt";
            $fh = fopen($myFile, 'a') or die("can't open file");
            
            $stringData = "$export";
            fwrite($fh, $stringData);
            fclose($fh);
 
}

Re: Errors in File Handling program

Posted: Mon Aug 24, 2009 9:20 am
by jackpf
Cool, nice one.