PDA

View Full Version : fread, fwrite?



carp
Mon 31st Jul '00, 7:49pm
I'm wanting to make a member script.

Could I use a *.txt file do store and display member names and passwords without using a database?

I was thinkink of using the fwrite function to put the members into the .txt file, then using the fwrite (or include() ) functions to display them.

Is this possible???
How can it be done???

Thanks!

vbsquare
Tue 1st Aug '00, 6:35am
The use fwrite(), do the following:

$filenum = fopen($filename,"w");
fwrite($filenum,"Some text");
fclose($filenum);

To use fread() do the following:

$filenum = fopen($filename,"r");
$contents = fread($filenum,filesize($filename));
fclose($filenum);

If you want to store a list, then you could use a common delimited file, and then exlpode() the $contents into an array.