ment1.jsp
上传用户:xjrzjk
上传日期:2022-07-31
资源大小:1585k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ page import="java.sql.*"%>
  3. <%
  4.   try{
  5.   //数据库连接
  6.   Class.forName("oracle.jdbc.driver.OracleDriver");
  7.   String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL";
  8.   String strUser = "eshop";
  9.   String strPassword = "eshop";
  10.   String strId = (String)request.getSession(true).getAttribute("LoginSuccess");
  11.   Connection con = DriverManager.getConnection(strUrl, strUser,strPassword);
  12.   Statement st = con.createStatement();
  13.   String sql = "select * from reguser where userid ='" + strId +"'";
  14.   ResultSet rs = st.executeQuery(sql);
  15. %>
  16. <html>
  17. <head>
  18. <title>
  19. 商品结算
  20. </title>
  21. <link rel="stylesheet" type="text/css" href="style.css">
  22. <SCRIPT language=javascript>
  23. function FORM1_onsubmit()
  24. {
  25. if (document.FORM1.Name.value.length==0)
  26. {
  27. alert("请输入正确的会员帐号。");
  28. document.FORM1.Name.focus();
  29. return false;
  30. }
  31. if (document.FORM1.Address.value.length==0)
  32. {
  33. alert("请输入正确的会员帐号。");
  34. document.FORM1.Address.focus();
  35. return false;
  36. }
  37. if (document.FORM1.Phone.value.length==0)
  38. {
  39. alert("请输入正确的会员帐号。");
  40. document.FORM1.Phone.focus();
  41. return false;
  42. }
  43. if (document.FORM1.Zip.value.length==0)
  44. {
  45. alert("请输入正确的会员帐号。");
  46. document.FORM1.Zip.focus();
  47. return false;
  48. }
  49. if (document.FORM1.Email.value.length==0)
  50. {
  51. alert("请输入正确的会员帐号。");
  52. document.FORM1.Email.focus();
  53. return false;
  54. }
  55. }
  56. </SCRIPT>
  57. </head>
  58. <BODY>
  59. <%
  60.   if (rs.next()){
  61. %>
  62.       <DIV align=center> 
  63.         <p> </p>
  64.       <FORM language=javascript name=FORM1 onsubmit="return FORM1_onsubmit()"
  65.       action=ment2.jsp method=post>
  66.       <INPUT type=hidden value=<%=rs.getString("UserId")%> name=UserId>
  67.       <TABLE cellSpacing=0 cellPadding=0 width=362>
  68.         <TBODY>
  69.         <TR>
  70.           <TD align=middle width="372">
  71.             <TABLE cellSpacing=1 cellPadding=4 width=388 bgColor=#000000>
  72.               <TBODY>
  73.               <TR vAlign=top bgColor=#eeeeee>
  74.                 <TD  colSpan=2 width="374" bgcolor="#006699">
  75.                   <p align="center"><font color="#FFFFFF">购物结算--(第一步)收货人信息</font></p>
  76.                 </TD></TR>
  77.               <TR bgColor=#eeeeee>
  78.                 <TD  width=103 bgColor=#EEEEEE height=7 align="right">
  79.                   <p align="center">收货人姓名:</p>
  80.                 </TD>
  81.                 <TD  width=259 height=7 bgcolor="#EEEEEE">
  82.                   <p><INPUT maxLength=16 size=13 value="<%=rs.getString("Name")%>"
  83.                   name="Name" style="font-size: 14px"> </p>
  84.  </TD></TR>
  85.               <tr>
  86.                 <TD  width=103 bgColor=#EEEEEE height=7 align="right">
  87.                   <p align="center">收货人地址<SPAN
  88.                   >:</SPAN></p>
  89.                 </TD>
  90.                 <TD  width=259 height=7 bgcolor="#EEEEEE">
  91.                   <p align="center"><INPUT maxLength=16 size=36 value="<%=rs.getString("haddr")%>"
  92.                   name=Address style="font-size: 14px" > </p>
  93.  </TD>
  94.               </tr>
  95.               <tr>
  96.                 <TD  width=103 bgColor=#EEEEEE height=7 align="right">
  97.                   <p align="center">邮政编码:</p>
  98.                 </TD>
  99.                 <TD  width=259 height=7 bgcolor="#EEEEEE">
  100.                   <p><INPUT maxLength=16 size=13 value="<%=rs.getString("postcode")%>"
  101.                   name=Zip style="font-size: 14px"> </p>
  102.  </TD>
  103.               </tr>
  104.               <tr>
  105.                 <TD  width=103 bgColor=#EEEEEE height=7 align="right">
  106.                   <p align="center">联系电话:</p>
  107.                 </TD>
  108.                 <TD  width=259 height=7 bgcolor="#EEEEEE">
  109.                   <p><INPUT maxLength=16 size=23 value="<%=rs.getString("usephone")%>"
  110.                   name=Phone style="font-size: 14px"> </p>
  111.  </TD>
  112.               </tr>
  113.               <tr>
  114.                 <TD  width=103 bgColor=#EEEEEE height=7 align="right">
  115.                   <p align="center">电子信箱:</p>
  116.                 </TD>
  117.                 <TD  width=259 height=7 bgcolor="#EEEEEE">
  118.                   <p><INPUT maxLength=16 size=32 value="<%=rs.getString("Email")%>"
  119.                   name=Email style="font-size: 14px"> </p>
  120.  </TD>
  121.               </tr>
  122.               <TR vAlign=top bgColor=#eeeeee>
  123.                 <TD  colSpan=2 width="374" bgcolor="#EEEEEE">
  124.                   <p align="center">你可以修改以上内容</TD></TR>
  125.               <TR bgColor=#eeeeee>
  126.                 <TD  colSpan=2 width="374" bgcolor="#006699">
  127.                   <DIV align=center>
  128.                     <p align="center"><INPUT class=main type=submit size=3 value=下一步 name=Submit2>
  129.                   </DIV></TD></TR></TBODY></TABLE>
  130.           </TD></TR></TBODY></TABLE>
  131.       <p align="center"><BR></FORM>
  132. </DIV>
  133. <%
  134.   }
  135. %>
  136. </BODY>
  137. </html>
  138. <%
  139.   }catch(Exception e){
  140.     throw (e);
  141.   }
  142. %>