Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page import="java.io.*,java.util.*,java.sql.*"%>
- <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%
- String user = request.getParameter("uname");
- String pwd = request.getParameter("pass");
- String fname = request.getParameter("fname");
- String lname = request.getParameter("lname");
- String email = request.getParameter("email");
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/usersinfo",
- "root", "Slnm1855");
- Statement st = con.createStatement();
- //ResultSet rs;
- int i = st.executeUpdate("insert into members(F_name, L_name, email, username, password) values ('" + fname + "','" + lname + "','" + email + "','" + user + "','" + pwd + "','");
- if (i > 0) {
- //session.setAttribute("userid", user);
- response.sendRedirect("forms.jsp");
- // out.print("Registration Successfull!"+"<a href='index.jsp'>Go to Login</a>");
- } else {
- response.sendRedirect("SQLHomePageLogin.jsp");
- }
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement