PDA

Click to See Complete Forum and Search --> : PHP - File Manipulation Question


LucaUWF
Jun 5th, 2003, 08:59 AM
I'm new to php and I'm looking for File Handling information.

A quick search on the web seems to suggest that I can write to a file, open a file and even append to a file... but the only way they seem to actually get a file created on the server is to actually upload it.

Is there a way to create a file on the server using php.

For example, say when a new user fills in a form, his details are saved to a text file.

*I don't want to use a Database to store this info*

TIA

LucaUWF
Jun 5th, 2003, 09:18 AM
Ok, according to one site if I try to write to a file that doesn't exist it attempts to create it.

But in the next line it says you can only write to a file with permissions set to enable this enable chmod777 or something.

Question is, if it doesn't exist at the time... how?

Can you set a folder to be writtable, and if so, would this work?

TIA

The Hobo
Jun 5th, 2003, 11:57 AM
What the site meant was that the folder (that you're going to create the file in) must be set to 777 in order to create it.

The best resource on PHP functions is hands down the PHP Manual. Check out: http://www.php.net/manual/en/ref.filesystem.php