Checking candidates Info with Pin/access code

Dear please i am developing a school web site which i want all my student to check their results online
i am using php amd mysql but one problem
i want to be givin out pin/access code to my syudents so that before they can see their score they had to enter the pin
i thinked about this becaise some of my students dont use to pay so i want to just have a pin generating page where i can generate pins/ Codes and the pins will be valid except after five usage.
Again you can not use the same pin to check another result so how do i do that
help me

please any help will be welcome
here is my email address

please don’t post your email addresses. this only increases the amount of spam you get.