Advertisement
Yuvalxp8

Send Info To MySQL From RegisterPage

Apr 4th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.33 KB | None | 0 0
  1. <%@ page import="java.io.*,java.util.*,java.sql.*"%>
  2. <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  5. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  6.     pageEncoding="ISO-8859-1"%>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <link rel="stylesheet" type="text/css" href="cssForTopBar.css">
  11.  
  12. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  13. <title>Insert title here</title>
  14. </head>
  15. <body>
  16. <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
  17.              url="jdbc:mysql://localhost/usersinfo"
  18.              user="root"  password="Slnm1855"/>
  19.  
  20.     <sql:query dataSource="${snapshot}" var="result">
  21.         SELECT * FROM members;
  22.     </sql:query>
  23.     <sql:update dataSource="${snapshot}" var="insert">
  24.     INSERT INTO members (F_name, L_name, email, username, password) VALUES ('<%= request.getParameter("fname") %>', '<%= request.getParameter("lname") %>', '<%= request.getParameter("email") %>', '<%= request.getParameter("uname") %>', '<%= request.getParameter("pass") %>');
  25. </sql:update>
  26.  
  27. <%
  28.         response.sendRedirect("SQLHomePageLogin.jsp");
  29. %>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement