faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 13 people (62%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I write to a file, what a user has input into a form

May 21st, 2003 08:29
James Prestwood, Stuart Hamilton,


$writedata = "*VARS TO BE WRITTEN*";
$datafile = fopen("*FILE TO WRITE TO*", "w");
fwrite($datafile, $writedata);
fclose($datafile);
just put the correct info where the *...* are and if you want to append 
to a file rather than overwrite it change $datafile = fopen("*FILE TO 
WRITE TO*", "w"); to $datafile = fopen("*FILE TO WRITE TO*", "a");