tags:

views:

300

answers:

1

this the first time i use jsp, and i face some problems.

i want to know how to check teh login if i have to tyoe of login. for examplem i have the student and professor. when the anyone is login it should check if he student or professor to forward him to the right page, the student should go to the take_quiz.jsp page and the professor should go to add_quiz.jsp page . so can anybody tell me how to do that

A: 

You can use two ways:

1-

using (IF Else) for your example

if(password for this ID = Password in "Student" table) then Forward him to Take_Quze.pjs else ( if (password for this ID = Password in "Professor" table) then forward him to proffesor.jsp else put error message )//end else

but it's not effictive way.

--

2- another ways is use separate login forms for Student and Professor, in JSP, you can use two directories, for example /professor/logi.jsp for Prof and /Student/login.jsp for student..

That's all.. :)