student code with pin Authentication help request

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

student code with pin Authentication help request

Post by bjrules »

and I want to ask some question.
I am a growing, up-coming web developer and I want to develop an
application that can enable
the students in a high to check their results online.
each students have a student code .
each time a student want to check his/her result for the year, the
student will collect a card from the computer administrator and the
student will have to input his/her student code and the code on the card
collected from the computer administrator as the username and password
respectively.
adn if the user of the card login with his/her student code for five time the card becomes invalid
how can I achieve this with php/mysql. hope to hear from you soon.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: student code with pin Authentication help request

Post by Christopher »

The first question you get here is, "What have you tried already?" If you have some code you have tried, please post it.

It sounds like the first thing you want to do is the log-in code. Do you have a database available?
(#10850)
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

Re: student code with pin Authentication help request

Post by bjrules »

hi christopher yes I have worked on a user authentication login system with mysql database which validates username and password but in this case the student does not know the PIN he only knows the student code .the computer administrator only issue the students the card the contains the PIN randomly. so the student code serves as the username while the Pin(from the card) serves as the password
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: student code with pin Authentication help request

Post by Christopher »

Can the PINs be used for five accesses to any account?
(#10850)
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

Re: student code with pin Authentication help request

Post by bjrules »

Yes the PIN can be used to authenticate any user at first but, Once a user enters the pin and it exits, then no other students can uses it and the PIN expires after 5 logins .
Thanks a lot.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: student code with pin Authentication help request

Post by Christopher »

So it sounds like you need to have a table containing the PINs. Each of those records will have a field to store a User ID and a counter set to five. The system when the person logs-in, the system will search for a record with that User ID and PIN. If it exists it and the counter is greater than zero it will decrement the counter and allow the login. If the counter is zero it will deny access. If no record is found it will search for a record with the PIN and no User ID set. If that is found it will set the User Id in the record, decrement the counter and allow the login.
(#10850)
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

Re: student code with pin Authentication help request

Post by bjrules »

Thanks for the Reply, You are right but, the student does not have the permission or right to create Student code or PIN , the student code is a unique identity number of each student in the school. the program must check if the student code and PIN exist in the database. but since any PIN can authenticate any Student code at the first login, but after the counter decrease or increases, (is after the first login) that very PIN cannot Authenticate any other user(Student) and if that very user's count reaches 5 the login will fail and the expiry message displays asking the user(Student) to contact the school Administrator for another PIN. Thanks
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: student code with pin Authentication help request

Post by Vegan »

looks like you need a field for the student-id and password

the pin seems to be distinct so you should use another table for it

are you looking to have a temporary PIN with a limit of 5 uses?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

Re: student code with pin Authentication help request

Post by bjrules »

@ vegan You are right, then how do I structre the query and write the php code for it
bjrules
Forum Newbie
Posts: 6
Joined: Tue Jan 17, 2012 8:30 am
Contact:

Re: student code with pin Authentication help request

Post by bjrules »

hello , anyone with the solution should please provide me with it
please
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: student code with pin Authentication help request

Post by Vegan »

go to php.net and download the manuals and start reading
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: student code with pin Authentication help request

Post by Christopher »

bjrules wrote:but, the student does not have the permission or right to create Student code or PIN , the student code is a unique identity number of each student in the school.
Yes, the student code/password and the PIN can only be created by an administrator. You will need to create the ability for administrators to create user accounts and new series of PINs.
bjrules wrote:the program must check if the student code and PIN exist in the database. but since any PIN can authenticate any Student code at the first login, but after the counter decrease or increases, (is after the first login) that very PIN cannot Authenticate any other user(Student)
Yes, as I said above -- the first time it finds an available PIN and sets the user code for it so no other use can use it. Each time after that it decrements the counter until the counter is zero.
bjrules wrote:and if that very user's count reaches 5 the login will fail and the expiry message displays asking the user(Student) to contact the school Administrator for another PIN. Thanks
Once the counter reaches zero then it can display that message to get a new PIN from an administrator.
(#10850)
Post Reply