网站的实例

源代码在线查看: submit_order.jsp

软件大小: 571 K
上传用户: zhangyuntong
关键词: 网站
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				 
				
				
								/*禁止使用浏览器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				                {
				                          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("订单提交成功!请记住你的订单号("+billid+")以便查询!返回首页");
								
				 %>			

相关资源