|PHP Form Script|
| 7:36 pm on Dec 27, 2005 (gmt 0)|
Hi, I need a php script written but I'm not sure what type of database I need and how many databases the script will require. I was wondering if anyone knows.
I need a script that does the following:
1. Has a few form fields (Full Name, Address, City... etc) and a few drop boxes.
2. When the form is submitted it writes the data into a xls file.
3. Every time the script is run a unique id (number) should be generated and written into the xls file together with the rest of the data.
4. Verifies that the telephone number matches the state when the form is submitted, otherwise it will return a error message.
5. Every time the form is submitted, it overwrites the existing xls file and combines the data in one file.
6. It saves the ip, date, time, and URL.
| 8:32 pm on Dec 27, 2005 (gmt 0)|
I don't think that a database is needed at all but rather careful use of PHP's file handling functions to manipulate the xls file.
| 9:11 pm on Dec 27, 2005 (gmt 0)|
The only reason I was thinking a database is needed is to store the xls file.
| 12:22 am on Dec 28, 2005 (gmt 0)|
Just store it like a regular file?
| 12:42 am on Dec 28, 2005 (gmt 0)|
So you think I could store it like a regular file, and the script can pull the file and update it when the form is filled out?
| 12:26 pm on Dec 28, 2005 (gmt 0)|
It may be quite messy to edit an xls file in that manner as opposed to editing a regular text file.
The alternative would be to use a database, not to store the xls file but to store the data which you could export to an xls file. I'm not 100% whether or not this is natively possible with MySQL but you can definitely export to HTML or XML quite easily.
| 3:05 pm on Dec 28, 2005 (gmt 0)|
Ok, thanks a lot!
| 10:30 pm on Dec 28, 2005 (gmt 0)|
If you use mysql - it doesn't natively export AS xls, BUT, you can output whatever you like to html and then use Excel's import web data feature to import it to an excel file.
Once you set up the file, you can just refresh it when you want to load whatever new data might be there.
It's also a quick and dirty way to keep backup copies of your raw data for small tables (less than 65,536 rows or so)