Registers the user with SQL Server, enters the registration information through the page, stores to the database.
<Form action="Zhuche.jsp" method="POST" onsubmit="returnReg (this); "><Div ID="Div2"> <P Style="Margin-left: 30px "><IMG SRC="Image/Pic_zc.gif "></Img></P> <div style="Width:350px;height:20px;margin-left: 30px;margin-Top:-10px "> <P><hr/></P> </Div> <P Style="Margin-left: 70px ">Please fill in your name:<input type="text"Name="UserName"></P> <P Style="Margin-left: 200px;margin-Top:-10px;font-Size:12px ">Please fill in the valid name as the next login username, and we will also send your account information, order notification and so on at this address.</P> <P Style="Margin-left: 100px ">Please set the password:<input type="Password" value="" Name="Password" datatype="*6- the"ErrorMsg="Password range at 6~Between 15 bits, you cannot use spaces! "/></P> <P Style="Margin-left: 35px ">Please enter the setting password again:<input type="Password" value="" Name="Repassword" datatype="*"Recheck=Password "errormsg="You entered the account password two times inconsistent!" "/></P> <P Style="Margin-left: 80px ">Please enter the verification code:<input type="text"Name="Yanz" style="width:50px"></P> <P Style="Margin-left: 250px;margin-Top:-40px; "><IMG SRC="Image/Code_img.gif "></Img></P> <P Style="Margin-left: 250px;margin-Top:-15px;font-Size:12px ">I can't see a change.</P> <P Style="text-Align:center; ">Please read<a href><Font Color="Red" style=The font-Weight:bold ">The "V+Website "Terms of Service"</Font></A></P> <P Style="text-Align:center; "><IMG SRC="Image/Sumit_bg.gif "></Img></P> <P Style="Margin-left: 129px;font-Weight:bold;color: #fff, margin-Top:-41px; "><input type="Submit" value="Agree to the above terms and register" style="Color: #8D0223"></P> </Div><!--Right div frame end -- </Form>
<%@ Page Language="Java" Import="Java.util.*"Pageencoding="UTF-8"%><%@pageImport="Jdbc.sqlserver"%><%@pageImport="Java.sql.Connection"%><%@pageImport="Java.sql.ResultSet"%><%@pageImport="Java.sql.PreparedStatement"%><%String UserName=request.getparameter ("UserName"); UserName=New String (Username.getbytes ("ISO-8859-1")," utf-8"); String Money =Request.getparameter (" Money"); String Password=request.getparameter ("password"); if(UserName==NULL &&Password==NULL){ %> <Script type="text/JavaScript>alert ("User name or password is not null"); Location="dolog.jsp"; </Script> <% } %> <% //Reference Connection database method SQL Server sq=new SQL Server (); //Get database connection Connection con=sq.getconnection (); //write SQL statement String SQL="Insert intoAdminValues (?,?,?)"; //Get database Operations Object PreparedStatement St=con.preparestatement (SQL); St.setstring (1, UserName); St.setint (2, $); St.setstring (3, password); //get the results of the queryif(St.executeupdate ()>0){ %> <Script type="text/JavaScript>alert ("Registered success"); Location="lindao.jsp"; </Script> <% }Else{ %> <Script language="JavaScript"> function Check(){ if(Password!=password2) {alert ("Two times password input is inconsistent, you can do it! "); } returntrue; } </Script> <% } %>
SQL Server implements user registration