I need some input
Posted by bschultz (bschultz), 26 February 2003I run a site for a high school (non-profit site) sports department. I’d like to get a way for coaches to submit their statistics and such after games, so that I don't have to enter them by hand in the morning.
I was thinking that an html form would work well for this. I started reading the manual on php.net and I must say I'm confused. I want the site viewers to be able to click on a schedule of games, (like the following: www.brainerdwarriors.org/sports/bbasketball/sked.shtml) and be able to see the statistics for the game.
There are 29 different sports, and each sport will have a different number of fields in the form.
I have a few questions, though as to what the best way to proceed might be:
Should I have the php script fwrite the form data, or put it in an array? If my understanding of what I've read is true, I'll have more flexability in the final layout in an array, right? Also, in a php array, where is the data “stored?”
How do I get the athletes names in the form, how do I take into account the many different numbers of forms and many different numbers of athletes on each form?
How do I get the final page name saved based on a selection in a drop box that would contain ALL the dates of the games for the whole season?
If you want to look at a sample form or two...they can be seen here:
I currently have these forms emailed to me after a coach submits the info.
Does all this make sense? What would you suggest...
Thanks for your time.
Posted by admin (Graham Ellis), 26 February 2003All very VERY do-able ... but I really don't know where to start writing. You could pick up so much from the PHP course I've been teaching this week and will be repeating next ...., and the question does really need a several-days-long answer!
Question: Are you presently just entering your data that the forms send you into .html documents, or into some form of database or content management system? I would almost certainly suggest keeping a text file description for each game type so that you can set you forms up automatically for your contributors, and also so that you can automatically present the data they enter.
Their data entry will, yes, go into arrays but that's transient - it will be lost at the time the PHP script (or session) expires, so you'll want to keep it in text files, or a database, or within HTML files made up directly by your submission script.
As soon as you start automating the process (taking your data re-entry out of the loop), you're alos going to need to look at user validation so that malicious people can't enter data - password protections perhaps. You'll also need to be looking at how your contributors can correct and update information that they've already entered (they won't always get it right), and you'll need a system that they'll find easy to use ....
Personally, I would write an application like the one you're looking for over a couple of days, but newcomers take many many times longer - I've been at it for years - so you set yourself a big task. You might also like to look at content management systems that are available out there as an alternative - after all, why re-invent the wheel?
This is a first answer ... hope it gives you some food for thought. No magic wand I can wave on this one - it could be a big project but a rewarding one and (if you do it well) one others may want to share with you. My wife looks after her high school alumni site through lots of hard work and is moving towards elements of automation, and it's amazing at how many folks write to her and say "how can I do one like this too"?
Posted by bschultz (bschultz), 26 February 2003Graham,
To answer your questions...
Yes, I enter the results by hand in an html document, and also enter them into a spreadsheet to tabulate season stats. I then convert the MS Excel spreadsheet into a pdf file for viewing on the site.
I've looked into pre-written scripts available out there, and I came across Phorm. It will write the data to a text file, and to a mysql database, but EACH sport, and each event for each sport needs it's own config file. That would be around 1000 config files! I don't like that idea at all.
I've also looked online for info on how to write and incorporate a text file description of each form...and can't find anything. Can you point me in thr right direction?
Thanks for all the help.
Posted by admin (Graham Ellis), 27 February 2003Well ... my guess is that you're going to need some sort of configuration file for each sport whatever solution you go for, but I guess that's 29 config files and not 1000!!!
There's a huge number of pre-written apps out there ... I would have a search around source forge, pehaps have a look at PHPNuke or something like that. Personally, I specialise in the coding of applications rather than using / suggesting pre-written ones, so I'm not the world's best to recommend but I'm sure there's something out there.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho