Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String d=request.getParameter("bday");
- Extra_User.jsp
- <html>
- <body>
- <form name="frm1" method="post" action="Extra_User_Data.jsp">
- <font size="4">Birthday<td><input type="date" id="bday">
- </form>
- </body>
- </html>
- Extra_User_Data.jsp
- <%@page import="java.sql.*"%>
- <%
- try
- {
- String d=request.getParameter("bday");
- Connection cn;
- Statement st;
- Class.forName("com.mysql.jdbc.Driver");
- cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/main","root","");
- st=cn.createStatement();
- st.executeUpdate("INSERT INTO newuser(dob)VALUES('"+d+"')");
- out.println("Insert SuccessFull");
- }
- catch(SQLException sq)
- {
- out.println(sq.toString());
- }
- %>
Add Comment
Please, Sign In to add comment