To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
<title>Welcome to our website</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
New User? <a href="Register.html">click here to register</a><br><br>
Old User? <a href="Login.html">click here to Login</a>
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
<title>Register Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<h1>New User Registration Page</h1>
<form action="Register.jsp">
Enter User Name<input type="text" name="txtName"><br><br>
Enter Password<input type="text" name="txtPass1"><br><br>
Re-Enter Password<input type="text" name="txtPass2"><br><br>
Enter Email<input type="text" name="txtEmail"><br><br>
Enter Country Name<input type="text" name="txtCon"><br><br>
<input type="submit" value="Resgister" name="submit">
<input type="reset" value="Reset" name="reset">
Created on : 25 Aug, 2022, 1:23:31 PM
<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
String uname=request.getParameter("txtName");
String pass1=request.getParameter("txtPass1");
String pass2=request.getParameter("txtPass2");
String email=request.getParameter("txtEmail");
String Cname=request.getParameter("txtCon");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/user_details","root","root");
PreparedStatement stmt = con.prepareStatement("insert into user_details value(?,?,?,?)");
stmt.setString(1,uname);stmt.setString(2,pass1);
stmt.setString(3,email);stmt.setString(4,Cname);
int row = stmt.executeUpdate();
if(row==1){out.println("Registration Successful");}
else{ out.println("Registration FAILED");
<jsp:include page = "Resgister.html"></jsp:include>
catch(Exception e){out.println(e);}
out.println("<h1>Password Mismatched</h1>");
<jsp:include page="Register.html"></jsp:include>
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
<title>Login Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<form action="Login.jsp">
Enter User Name<input type="text" name="uname"><br><br>
Enter Password<input type="text" name="pname"><br><br>
<input type="submit" value="Login" name="submit">
<input type="reset" value="Reset" name="reset">
Created on : 8 Sep, 2022, 11:58:52 AM
<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login JSP Page</title>
String uname = request.getParameter("uname");
String pass = request.getParameter("pname");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/user_details","root","root");
PreparedStatement stmt = con.prepareStatement("select Password from user_details where Username=?");
stmt.setString(1, uname);
ResultSet rs = stmt.executeQuery();
if(pass.equals(rs.getString(1))){
out.println("<h1> LOGIN SUCCESSFUL</h1>");
out.println("<h1> Wrong Password</h1>");
out.println("<h1>User Name not exist !!!!!</h1>");
<jsp:include page="Register.html"></jsp:include>
}catch(Exception e){out.println(e);}