Flat-File Databases

Submitted by gefiltefishee on Sat, 12/17/2005 - 2:53pm.
I am trying to learn how to write user (form) submitted data to a flat text file, rather than an sql database, because I don't have access to one. I need to be able to check user input against records in this file. Right now I am using the POST method of form submitting and am using the "extract($_POST, EXTR_OVERWRITE)" to get the variables into my php handling script. Here is my problem: I am trying to use the fopen, fwrite and fclose functions to write user input initially into the text file I have (.txt) but it says it doesn't have permission to access the file. What's wrong? Also, if anyone could please direct me to a site that has moderatly extensive resources on flat-file databases, I would greatly appreciate it. ~Nathan
robert Says:
Wed, 09/20/2006 - 11:02am

chmod("/somedir/somefile", 0755);

That is the PHP code for the *nix command that changes the permisions on a file.

You may also be able to do it with your ftp software by right clicking on the file and clicking on file attributes or something.

It is probably better to do it programaticly when the file is created.

see:
http://us2.php.net/manual/en/function.chmod.php

Reference:
PHP and MySQL Web Development
by Luke Welling & Laura Thomson

shoot me an email if you need to

Thank you for your time,
Robert H. Speer
http://www.robertspeer.com