Originally posted by epik_x
Ok i was messing around with that and I got it working. It works good any everything but it keeps updating the data from the form, how would I do it to have it keep the old data stuff and add new stuff and save it or add it to a html file?
?? Keep Messing??
Seriously, you're going to need to do some reading. I liked "PHP for the World Wide Web" by Larry Ullman, from PeachPit Press. Another thread around here recommended one that sounded maybe even better.....check the lounge forum. And don't forget TFM, at www.php.net...
With these tools, you can learn about:
fopen, fread, fwrite (functions to write files)
array() (which might allow you to save data while looping over and over a form)
and other cool stuff.
By way of example:
<?
$FileName="../webdata/attendance.txt";
$FilePointer= fopen ($FileName, "w");
fwrite ($FilePointer, "$LastWeek, $ThisWeek");
fclose ($FilePointer);
if ($FilePointer) {
include "header.html";
echo "<br><br>The file was successfully written to the server. Click <a href=\"attendance.html\">here</a> to view the report page.<br><br>";
include "footer.html";
} else { include 'header.html';
echo "<br><br>There was a system error and your file was not written correctly. Please contact the webmaster.<br><br>";
include 'footer.html'; }
?>
...a real simple script that wrote church attendance data from a form to a flat text file, which is displayed as HTML by a second script at "attendance.html". I hadn't had the book but 3-4 days....
G'luck
dalecosp