⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 submit_order.jsp

📁 网站的实例
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312"%>
<%@ include file="data.jsp"%>
<%@ include file="user_login.jsp"%>
<jsp:useBean class="ebs.Buyercar" id="buy" scope="page"> 
</jsp:useBean>
<jsp:useBean id="today" class="ebs.dateTransfer" scope="page"/>
<%
/*禁止使用浏览器Cache*/
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires",0);
%>
<%
String userid=request.getParameter("uid");
String date=today.strYear()+"-"+today.strMonth()+"-"+today.strDay();
String sql=null;
float price;
price=0;

                Cookie[] cookies=request.getCookies();
                for(int i=0;i<cookies.length;i++)
                {
                          String bid=cookies[i].getName();
                          String num=cookies[i].getValue();
                          int leng=bid.length();
                          if(bid.startsWith("BID")&&leng>=4)
                          {
                                 buy.setBookid(bid.substring(3)); 
                                 bid=buy.getBookid();                           
                                 price=buy.getBookprice();
                                 sql="INSERT INTO bill(user_id,book_id,bill_sum,book_price,bill_time) VALUES('"+userid+"','"+bid+"',"+num+","+price+",'"+date+"')";
				 Stmt.executeUpdate(sql);
			}
		}

String sql1="SELECT * FROM bill ORDER BY bill_id DESC";
Rst=Stmt.executeQuery(sql1);
Rst.next();
String billid=Rst.getString("bill_id");

Rst.close();
Stmt.close();
Conn.close();  
out.print("订单提交成功!<br>请记住你的订单号("+billid+")以便查询!<br><A href='index.jsp'>返回首页</A>");
				
 %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -