writing to files
Posted 16 August 2006 - 09:39 PM
im tryin to write to a file
$information = "blah blah";
$handle = fopen('$username.php', 'w+');
this script will run everytime someone fills in a form.
what i want to do, is each time a user submits the form, is to creat the file according to their username, then add some data, this includes varibles
for example if a user wi the name test filled in the form
i want to write on the file:
how would i go about gettin this to happen?
Posted 16 August 2006 - 09:50 PM
$filename = "path/to/file/$username.whatever"; $fp = fopen($filename, "x+b"); $somecontent = //your posted results fwrite($fp, $somecontent); fclose($fp);
Hope this helps,
Posted 16 August 2006 - 09:57 PM
I would think that is a better solution because you can write to it at the same time.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users