Click to See Complete Forum and Search --> : Validate if passkey is in database, submit form, remove passkey


Alegis
04-30-2006, 08:00 AM
Perhaps more SQL related than php

It's a small project, where a class of ~20 students submits a questionnaire to database (questions with values ranging from -2 to 2). I only wish them to be able to send in a form once.

I was thinking of generating x passkeys, insert them into a SQL table. The questionnaire should check if the given passkey is in that table, and if so send the form data to the correct table and remove the passkey from the list.

Of course I'm a PhP/SQL newbie and faced a brick wall. Any tips/hints to get me back on track ?

Thanks in advance

chazzy
05-01-2006, 10:27 PM
the passkey idea would be your best bet honestly. Generate 25 keys, and then have the answers fill in the slots associated w/ that key. other ways would involve some form of a log in system or cookies (which can be unreliable)

Alegis
05-02-2006, 11:38 AM
Fixed it by making a table with passwords. When loading questionnaire/sending data it first checks if the password is in that table. When sending the data, the code used is copied over. The second check is to see if the code does not exist in that table (to make sure it is not used more than once).

Thanks anyways !