How to count submitted forms and store their information without a DB?
I need way to:
a) count how many forms were submitted based on a specific form field value, as well as
b) preserve that data for later manipulation if needed, so I guess sending all form data to an email will not be enough.
About a)
The idea is to count, how many different form submissions have occurred.So let's say: Keeping something like:
Form containing a specific field value A was filled 100 times; Form containing a specific field value B was filled 200 times; Form containing a specific field value C was filled 500 times;We will have no more then 5 alternatives here.
I'm thinking about a txt file but, perhaps there is a nicer way ?
About b)
I would like to avoid building a database just for this still, I wish not to neglect the fact that, perhaps latter, that information should be retrieved somehow开发者_JAVA技巧.I'm thinking about a XML file... ?
Is there better ways? Perhaps using only XML for both cases and deal with this at once?
Any caveat that I should be aware of ?
Thanks a lot.
From your description I would say using sqlite would be an ideal solution. OK, I admit it is a database - but it is also a text file (which you can move about) and provides you with the means to easily filter and manipulate the data.
Take a look at PEAR::Log http://pear.php.net/package-info.php?package=Log
You can get an awful lot done with a little code.
Sqlite is bundled with PHP5+
There is an Sqlite PDO driver for Pear::Log here
精彩评论