Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page import ="java.sql.*" %>
- <%
- String userid = request.getParameter("uname");
- String pwd = request.getParameter("pass");
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/users",
- "root", "*Follow902010!*");
- Statement st = con.createStatement();
- ResultSet rs;
- rs = st.executeQuery("select * from members where uname='" + userid + "' and pass='" + pwd + "'");
- if (rs.next()) {
- session.setAttribute("userid", userid);
- response.sendRedirect("success.jsp");
- } else {
- out.println("Invalid password <a href='index.html'>try again</a>");
- }
- %>
Add Comment
Please, Sign In to add comment