Page 1 of 1

PHP/MySQL Based Quiz

Posted: Mon May 12, 2003 6:41 pm
by Foundation
Here's my project:

I want to put together a PHP/MySQL based quiz that scores the results, writes them to a database based on their firstName and lastName entries, and emails the results to an admin.

The features I need include:
If they take the quiz once, they can't take it again and overwrite their previous score.
If they miss a question, the results page will tell them the correct answer in red. If they get it right, the answer is in black.

The problem I have is that I'm a PHP novice and when I use setcookie() to keep them from going back, they can override it by clearing cookies. Also, I tried setting the cookie and checking for it on the same page but since it gets created before it's checked, it shows as being present everytime.

I have created a basic system that scores the quiz and gives them the result, but I can't get the function to work for db writing or to keep them from redoing the quiz.

Any help would be greatly appreciated.

Thanks!

Posted: Mon May 12, 2003 7:57 pm
by volka
you might use sessions and/or the database to maintain the quiz's state.
Although sessions (by default) use cookies, too, the user does not benefit from changing the value.

Posted: Tue May 13, 2003 8:41 am
by Foundation
I'll try the sessions approach today and see how that goes.

Thanks for the tip.