Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,989 members, 7,821,451 topics. Date: Wednesday, 08 May 2024 at 01:09 PM

Need Help On Login Page - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Help On Login Page (1107 Views)

Please Help On My Login Page / Creating A User Login Page Where.. / Registration/login Page With Php (2) (3) (4)

(1) (Reply) (Go Down)

Need Help On Login Page by Nobody: 11:36pm On Jul 22, 2012
I just started a project on a scratch card website. The website will be of similar function as the waec site.
My problem is that when a new applicant have to login with its pin and serial number how will validate the pin & serial(so that i will be sure the pin and serial exist) and also if the pin is already used or does not valid how do i go about it.

Thanks very much as you reply.
Re: Need Help On Login Page by naijaswag1: 12:19am On Jul 23, 2012
which language or is it php by default?
Re: Need Help On Login Page by Nobody: 3:15am On Jul 23, 2012
^^asp.net4.0 c#
Re: Need Help On Login Page by Nobody: 6:10am On Jul 23, 2012
naija_swag: which language or is it php by default?
asp.net 4.0, c#
even if u don't code in d above language, you can still give me details on how to go about it
Re: Need Help On Login Page by Chimanet(m): 10:03am On Jul 23, 2012
U have 2 seperate tables, tableA wil have id column which is a primary key auto increment, pin column a varchar, this table wil have all ur pins already loaded. The 2nd table, TableB, Will have a primary key id which is a foriegn key 2 tableA id column, user_id column which is a user id mapped from ur users table as a foreign key, a kind of user table must exist cos u must keep track of usernames or regnumbers dat uniquely identifies ur candidates. An Amount column which is an integer 2 keep track of d amount of time d user have used dat particular scratch card wit d corresponding pin on tableA, dis column should b incremented on each usage. So d behaviour is lyk dis, each time a user enters a pin and and regnumber, u check if d entered pin exists on tableA and d regnumber exists on d user table, if it passes d test, u retrieve d matching id of d pin, and matching id of d reg number from both tablesA and user tables. then check if d retrieved pin id exist on tableB, if yes check if it matches d user id as a row in tableB, if no, u insert a new row wit d id , userid , and amount set to 1.else if yes, u knw is a used scratch card, get d corresponding amount on dat row. Make sure u use ur code 2 limit d amount of usage. If d amount is equal 2 or more dan d limit, u issue an expired pin error, else increment d amount column and allow d user access to his or her result. Jst hope u grab d concept
Re: Need Help On Login Page by Nobody: 11:11am On Jul 23, 2012
^^ thanks for your responds, will try it if there is any problem i will let you know.
Re: Need Help On Login Page by Chimanet(m): 11:25am On Jul 23, 2012
liaslo++:
^^ thanks for your responds, will try it if there is any problem i will let you know.
you r welcome.jst try it,
Re: Need Help On Login Page by Nobody: 6:24am On Jul 24, 2012
Thanks, i still have one other problem to deal with.
After the applicant fill up the form and click the submit button, how can i give the exam centre to the user(having in mind that 10 different schools are to be use for the exam and not all the school contains equal number of candidate), how do i give each of the candidate it seat number without exceeding the amount that particular school can contain.
Thanks.
Re: Need Help On Login Page by Chimanet(m): 9:33am On Jul 24, 2012
liaslo++:
Thanks, i still have one other problem to deal with.
After the applicant fill up the form and click the submit button, how can i give the exam centre to the user(having in mind that 10 different schools are to be use for the exam and not all the school contains equal number of candidate), how do i give each of the candidate it seat number without exceeding the amount that particular school can contain.
Thanks.
ok, dis doesnt realy nid a database 2 code, is more of a logic problem. Think of it dis way, u have a class dat has a static integer field called seat. Dis variable holds d seat number of d previous registered student. So each registeration of a candidate d value is incremented by 1 and its value is assigned as d seat number of d new registered candidate. Ok, U now use a switch case 2 check d sch dat d new candidates seat number falls into. Like if seat number is btw 100 and 149 go 2 schB, if seatnumber is between 150 and 249 go 2 schC. U c d range of seats gives u power 2 determine hw many seats each center has. Dat is jst it, dis algorithm is a functional solution but nt a full object oriented solution but works well 4 wat i call a sharp sharp projects. i do hope u undastand wat a static field does here.:-/
Re: Need Help On Login Page by Nobody: 5:06pm On Jul 25, 2012
^^ the seat at each school is 4rm 1 to ... like sch A is from 1 to 100 and sch B is frm 1 to 150. Both schools seat number will be frm 1 but not contain equal number of candidate
Re: Need Help On Login Page by Nobody: 11:44pm On Jul 25, 2012
good approach, but why dont you just add 2 columns to the table that contains the pin

to make it easier, i'll call them pin_usage and pin_user

pin_usage holds how many times pin was used, this will default to zero
pin_user hold the id of the very user who is using/used the pin, this also default to zero

the reason being that 1 user could use more than 1 pin

so to validate, you First

select id from userTable where matric=excaped_user_submitted_matric

lets call whats returned, user_id

next

select pin_user, pin_usage from pinTable where pin=escaped_user_submitted_pin and serial=escaped_user_submitted_serial

if this query returns nothing, tell user he submitted and invalid pin/serial

so within your application
if pin_user == user_id (from first query)
then this user has used the pin, so you need to go ahead and just check if pin_usage > 5

if pin_user == 0
then this is a new pin usage attempt, let the user in.

This is where a lot of Jamb/WAEC/NECO developers mix things up
they just go ahead and say pin_usage+1, and update the usage. Very wrong.

When a lot of users try to access the application and due to bottlenecks, no one could get it
the server may be able to execute the update part and may not return result to user, before the user refreshes and that becomes another usage.

the best is to allow the user in, then at the bottom of the html page, add the update pin_usage+1 query
this guarantees the user sees the result before the pin_usage table is updated
Re: Need Help On Login Page by Chimanet(m): 7:34am On Jul 26, 2012
liaslo++:
^^ the seat at each school is 4rm 1 to ... like sch A is from 1 to 100 and sch B is frm 1 to 150. Both schools seat number will be frm 1 but not contain equal number of candidate
ok, wat u do is make ExamCenter class dat has centreName a string, maxSeat an integer, currentSeat an integer should always b synchronize, ok put dem in a list, once a user register use a for loop 2 transverse d list, if an examcenter object has its seatnumber less than its maxseat, increment d seat number and assign its value 2 to d registered candidate and its centerName 2 d examcenter of d new candidate. U now increment d seat number of d object by 1, and return immidiatly 2 halt d for loop. Dnt use break here o!

(1) (Reply)

All Programmers Please Help Me About Programming / Learn HTML & CSS Coding With Ease!! / Learn Best Frontend Development Practises

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 25
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.