SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <% |
| 1 | + | <% |
| 2 | - | String result[][] = db.select("select * from members
|
| 2 | + | String n=request.getParameter("username");
|
| 3 | - | where username='"+n+"' |
| 3 | + | String p=request.getParameter("password");
|
| 4 | - | and password='"+p+"'"); |
| 4 | + | |
| 5 | - | if(result.length>0){
|
| 5 | + | |
| 6 | if(p!=null && n!=null) | |
| 7 | {
| |
| 8 | session.setAttribute("name",n);
| |
| 9 | session.setAttribute("pass",p);
| |
| 10 | if(n.equals("Dor") && p.equals("123456") )
| |
| 11 | {
| |
| 12 | session.setAttribute("status","admin");
| |
| 13 | response.sendRedirect("AdminArea.jsp");
| |
| 14 | } | |
| 15 | else | |
| 16 | {
| |
| 17 | String result[][] = db.select("select * from members where username='"+n+"' and password='"+p+"'");
| |
| 18 | if(result.length>0){
| |
| 19 | ||
| 20 | session.setAttribute("status","member");
| |
| 21 | response.sendRedirect("UserArea.jsp");}
| |
| 22 | else | |
| 23 | {
| |
| 24 | session.setAttribute("status","guest");
| |
| 25 | response.sendRedirect("login.jsp");
| |
| 26 | } | |
| 27 | ||
| 28 | } | |
| 29 | ||
| 30 | ||
| 31 | } | |
| 32 | %> |