📄 zhucechuli.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style5 {color: #FF0000; font-size: 16px; }
body {
background-image: url(image/u=3751729908,81688770&gp=1.jpg);
}
.style7 {color: #FF0000}
.style9 {color: #FF0000; font-size: 18px; font-weight: bold; }
-->
</style>
</head>
<body>
<%
int n;
String user=new String();
String usermima1=new String();
String usermima2=new String();
String userid=new String();
String usersex=new String();
String userphone=new String();
%>
<%
user=request.getParameter("textfield1");
usermima1=request.getParameter("textfield2");
usermima2=request.getParameter("textfield3");
userid=request.getParameter("textfield4");
usersex=request.getParameter("radiobutton");
userphone=request.getParameter("textfield5");
n=user.length()*userid.length()*usermima1.length()*usermima2.length()*usersex.length()*userphone.length();
%>
<%
if(n==0){
%>
<span class="style9">有未添的注册信息!</span><a href="zhuce.jsp">返回</a>
<%
}
if(n!=0){
if(!(usermima1.equals(usermima2))){
%>
<span class="style5">密码不符!</span><a href="zhuce.jsp">返回</a>
<%
}
if(usermima1.equals(usermima2)){
String url=new String();
url="jdbc:odbc:userg1";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
String SQL=new String();
SQL="SELECT * FROM user WHERE user='"+user+"'";
ResultSet rs=stmt.executeQuery(SQL);
int flag=1;
if(rs.next()){
flag=0;
%>
<span class="style5">该用户存在!<a href="zhuce.jsp"></a></span><a href="zhuce.jsp">返回</a>
<%
}
rs.close();
if(flag==1){
SQL="INSERT INTO user (id,user,mima,sex,telephone) VALUES('"+userid+"','"+user+"','"+usermima1+"','"+usersex+"','"+userphone+"')";
stmt. executeUpdate(SQL);
String SQL2=new String();
SQL2="CREATE TABLE "+user+" (name TEXT,price INT,shuliang INT)";
stmt.executeUpdate(SQL2);
%>
<span class="style9">恭喜注册成功!</span><span class="style7"><a href="index.jsp">返回首页</a></span>
<%
}
stmt.close();
con.close();
}
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -