Compiling data from a form
Hello,
I'm currently using a form on my site to allow users to vote for officers in our organization. Currently, I receive an email indicating what the person entered on the form when he submits the form. I then have to manually tally the data that I receive. Is there a way to have the system automatically tally the results? Thanks.
Bob
Vincent Puglia posted this at 02:14 — 24th May 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
cgi.
if you have a guestbook, you might be able to send the info there -- place it in a var, read it, increment it, rewrite it by appending.
Vinny
------------------
GrassBlade: cut&paste javascript
The Javascript Place Forums
Where the world once stood
the blades of grass cut me still
Bob posted this at 02:27 — 24th May 2000.
They have: 117 posts
Joined: Feb 2000
Vinny,
Thanks for the reply. I do have a guestbook, but I'm at a loss as to how I would place data sent to the guestbook into a var, then read it. Any chance that you would have some sample code of how to do that? Thanks again.
Bob
Anonymous posted this at 04:45 — 24th May 2000.
They have: 5,633 posts
Joined: Jan 1970
Take a look at:
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Survey_and_Voting/
------------------
Adam
AIS Internet Solutions
[email protected]
www.aisinternet.com
Lloyd Hassell posted this at 05:14 — 24th May 2000.
They have: 231 posts
Joined: Feb 2000
Vinny is right - you need CGI. You don'y need to get the results in email format, you can get this data sent directly to a script which can organise it for you. The script can store the data in a database or a text file.
I will move this post to the Cgi & Perl Forum.
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
anti posted this at 10:12 — 24th May 2000.
They have: 453 posts
Joined: Jan 1999
Hi,
if your host only allows form2mail-cgis,
you can automate the local process.
Here's what I do:
- user enters data into form
- from2mail sends it to a special pop3 mailbox
- fetchmail takes the mail from that pop3 once every 6 hours
- procmail does some simple pre-sorting
- a small perl-script parses the data and puts it into a mySQL table
once every few days (or more often if needed) :
- another script runs and extracts all data from mySQL into "data"-files
- wml runs and packages "data" and templates
- sitecopy uploads the stuff
That's how the "news" on linux-history.org work.
(Well, there is some verification involved, but that's "nice to have" and not essential.)
Bob posted this at 14:15 — 24th May 2000.
They have: 117 posts
Joined: Feb 2000
Vinny, Adam, Lloyd and Anti -
Thanks for your responses. I found a place through the site Adam recommended that will let me basically do what I want, but I'd like to be able to do it myself (to have more control over the format and to avoid the advertising).
Lloyd, would it be possible to give me a small example of how I can have the data sent to a script for processing? I assume I would use the onSubmit="function()" in the <form> tag? This would allow me to process the data in a script? Then how can I write the data to a database at that point? If you could give me a small example, maybe I could figure it out from there.
Thanks again for all the help.
Bob
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.