📄 zhanshi.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%
String spath="wangye/ec.mdb";
String dbpath = application.getRealPath(spath);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+dbpath;
Connection conn= DriverManager.getConnection(url,"","");
Statement stmt=conn.createStatement();
String username=(String)session.getAttribute("username");
String leixing=request.getParameter("type");
String sql="select * from goods where zhonglei='"+leixing+"'";
ResultSet rs=stmt.executeQuery(sql);
int goodsID=-1;
String goodsname="";
int number=-1;
String introduct="";
String pic="";
int price=-1;
%>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="770" border="1" align="center">
<tr>
<th colspan="7" scope="col"><img src="../image/1.jpg" width="760" height="200" /></th>
</tr>
<tr>
<th width="104" height="40" background="../image/t1.jpg" scope="row"><table width="100" border="0">
<tr>
<th scope="col"><a href="../index.jsp">首页</a></th>
</tr>
</table></th>
<td width="104" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col"><a href="#">数码</a></th>
</tr>
</table></td>
<td width="104" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col">服装</th>
</tr>
</table></td>
<td width="104" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col">饰品</th>
</tr>
</table></td>
<td width="104" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col">家电</th>
</tr>
</table></td>
<td width="104" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col">食品</th>
</tr>
</table></td>
<td width="100" background="../image/t1.jpg"><table width="100" border="0">
<tr>
<th scope="col">日用</th>
</tr>
</table></td>
</tr>
</table>
<table width="770" border="1" align="center">
<tr>
<th width="754" bgcolor="#A6BBFC" scope="col" ><marquee direction="left" scrollamount="1" scrolldelay="1" onMouseOver="this.stop();" onMouseOut="this.start();">
<%if(username==null || username==""){%>
<font color="#330000">顾客您好!购买商品请先登录</font> <a href="../zhuce.jsp" >[新用户注册]</a>
<%}else{%><%=username%> <font color="#330000">您好! 电子商务交易平台欢迎您!</font>
<%}%>
</marquee></th>
</tr>
</table>
<table width="770" border="1" align="center">
<tr>
<th width="200" height="180" valign="top" bgcolor="#FFF8B0" >
<% if (username==null || username==""){%>
<form name="form1" method="post" action="Login_U.jsp">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr> </tr>
<tr>
<td width="94%" height="24"> <div align="center">会员名
<input name="username" type="text" id="username" size="16">
</div></td>
</tr>
<tr>
<td height="24"><div align="center">密 码
<input name="PWD" type="password" id="PWD" size="16" >
</div></td>
</tr>
<tr>
<td height="31">
<input name="Button" type="button" value="注册" onClick="window.location.href='zhuce.htm'">
<input name="Submit2" type="submit" value="登录" >
<input name="Submit3" type="reset" value="重置"></td>
</tr>
</table>
<%}else{%>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="94%" height="31" align="center" >[<%=username%>]您好!<br>
您现在可以购物了!</td>
</tr>
<tr>
<td height="24" align="center">
<input name="Submit22" type="button" value="修改资料" onClick="window.location.href='modifyMember.jsp';">
<input name="Submit33" type="button" value="购 物 车" onClick="window.location.href='cart_see.jsp';">
<input name="Submit32" type="button" value="订单管理" onClick="window.location.href='ordermanage.jsp';"></td>
</tr>
<tr> </tr>
</table>
<%}%>
</form> </th>
<th width="554" rowspan="2" bgcolor="#FFFACE">
<% while(rs.next()) {
goodsID=rs.getInt(1);
goodsname=rs.getString(2);
introduct=rs.getString(5);
pic=rs.getString(6);
price=rs.getInt(7);
%>
<table width="98%" height="106" border="0" cellpadding="0" cellspacing="0" class="noborder">
<tr>
<td width="37%" height="95" rowspan="4" align="center"><img src="../image/<%=pic%>.jpg" width="184" height="119"></td>
<td><%=goodsname%></td>
</tr>
<tr>
<td>单价:<%=price%>(元) </td>
</tr>
<tr>
<td><%=introduct%></td>
</tr>
<tr>
<td height="52"><input name="Submit" type="submit" onClick="history.back(-1);" value="返回">
<%if (username!=null && username!=""){%>
<input name="see11" type="submit" onClick="window.location.href='cart_add.jsp?goodsID=<%=goodsID%>';" value="购买">
<%}%></td>
</tr>
</table>
<%}%>
<br>
<%
rs.close();
stmt.close();
conn.close();
%> </th>
</tr>
<tr>
<th bgcolor="#FFF8B0" scope="col"> </th>
</tr>
</table>
<table width="770" border="1" align="center">
<tr>
<th background="../image/2.jpg" scope="col"><br>
<p><a href="#"><font size="2">关于我们</font></a>
<font size="2"> |
<a href=# onclick="">加入收藏</a> | <a href=# onClick="">设为首页</a> | <a href="#">请您留言</a><br><br>
电子商务交易平台 版权所有</font></p><br>
</th>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -