📄 register.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background-image: url(picture/background.JPG);
}
-->
</style></head>
<body>
<%
//String roomcode1;
String name1;
String sex1;
String age1;
String certclassno1;
String certificate1;
String countryno1;
String year1;
String year2;
String month1;
String month2;
String day1;
String day2;
String remarks1;
String price1;
String arridate1="";
String leftdate1="";
//String register_date1;
String roomcode_rec=request.getParameter("roomcode_send");
out.print(roomcode_rec);
String roomcode1=roomcode_rec.substring(0,4);
out.print("====");
out.print(roomcode1);
out.print("====");
//roomcode1=request.getParameter("roomcode1");
if(roomcode1==null){
roomcode1="1001";
}
name1=request.getParameter("name1");
if(name1==null){
name1="";
}
//sex1
sex1=request.getParameter("sex1");
age1=request.getParameter("age1");
certclassno1=request.getParameter("certclassno1");
certificate1=request.getParameter("certificate1");
countryno1=request.getParameter("countryno1");
year1=request.getParameter("year1");
month1=request.getParameter("month1");
day1=request.getParameter("day1");
year2=request.getParameter("year2");
month2=request.getParameter("month2");
day2=request.getParameter("day2");
remarks1=request.getParameter("remarks1");
price1=request.getParameter("price1");
out.print(roomcode1);
out.print(name1);
out.print(sex1);
out.print(age1);
out.print(certclassno1);
out.print(certificate1);
out.print(countryno1);
out.print(year1);
out.print(month1);
out.print(day1);
out.print(year2);
out.print(month2);
out.print(day2);
out.print(remarks1);
out.print(price1);
arridate1=arridate1+year1+"/"+month1+"/"+day1;
leftdate1=leftdate1+year2+"/"+month2+"/"+day2;
//out.print("++++++++++++++");
out.print(arridate1);
out.print(leftdate1);
//logip1=request.getRemoteAddr();13810000602
//java.util.Date logtime1=new java.util.Date();
//register_data1=(logtime1.getYear()+1900+"-"+"(logtime1.getMonth()+1)"+"-"+(logtime1.getDate()));
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:lmyl";
String user="sa";
String password="013078";
ResultSet rs=null;
String deusername="";
Connection con=DriverManager.getConnection(url,user,password);
Statement stmt=con.createStatement();
String condition="";
//condition=condition+"INSERT INTO guests(roomcode,name,sex,age,certclassno,certificate,countryno,arridate,leftdate,remarks,price) VALUES ('"+roomcode1+"','"+name1+"','"+sex1+"','"+age1+"','"+certclasno1+"','"+certificate1+"','"+countryno1+"','"+arridate1+"','"+leftdate1+"','"+remarks1+"','"+price1+"',)";
//condition=condition+"INSERT INTO guests(roomcode,name,sex,age,certclassno,certificate,countryno,arridate,leftdate,remarks,price) VALUES ('e','e',e'','e','e','e','e','e','e','e','e','e',)";
condition=condition+"INSERT INTO guests (roomcode,name,sex,age,certclassno,certificate,countryno,arridate,leftdate,remarks, price) VALUES ('"+roomcode1+"','"+name1+"','"+sex1+"','"+age1+"','"+certclassno1+"','"+certificate1+"','"+countryno1+"','"+arridate1+"','"+leftdate1+"','"+remarks1+"',500)";
stmt.executeUpdate(condition);
out.println(" no problem");
condition="UPDATE roomstate SET roomstate = 'l' WHERE (roomcode ='"+roomcode1+"') ";
//condition="UPDATE roomstate SET roomstate = 'l' WHERE (roomcode =1003)";
stmt.executeUpdate(condition);
out.println(" no problem 2");
stmt.close();
con.close();
}
catch(Exception e){
System.err.println("LMYL ERROR!!"+e.getMessage());
}
//boolean key=true;
//String condition="SELECT * FROM yl_register WHERE username='"+username1+"'";
//rs=stmt.executeQuery(condition);
/*while(rs.next()){
deusername=rs.getString("username");
//out.println("jinru");
out.println("1"+deusername+"1");
out.println("1"+username1+"1");
//if(username1=="yuyang"){
if(username1==deusername){
out.println(" 已存在");
key=false;}
//else{out.println(" no problem");
//}
}*/
/*while(rs.next()){
key=false;
out.println(" 用户名已存在!!");%>
<br />
<br />
<%}
//int whilei=1;
//while((password1!=repassword1)&&(whilei==1)){
// key=false;
//if(password1!=repassword1){
//key=false;
//out.println(" 两次密码输入不同!!");%>
<br />
<% //whilei--;
*/
//}
/*if(key){
//out.println(" no problem");
String querystring="insert into yl_register(username,password,repassword,email,truename,sex,phone,phone2,logip)values('"+username1+"','"+password1+"','"+repassword1+"','"+email1+"','"+truename1+"','"+sex1+"','"+phone1+"','"+phone2+"','"+logip1+"')";
stmt.executeUpdate(querystring);
stmt.close();
con.close();
out.println(" 恭喜注册成功!!");*/
//}
//else{
//stmt.close();
//con.close();
//}
%>
</p>
<p align="center">请单击<a href="index.htm">返回登陆</a>页面</p></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -