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

📄 index.jsp

📁 用JSP写的一个在线购物网站的代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*,java.util.*,shop.buy.buy" %>
<jsp:useBean id="data" scope="page" class="shop.data.conn" />
<script language="JavaScript">
function check()
{
  if(document.loginfrm.name.value.length==0)
  {
     alert("请填写您的用户ID");
	 document.loginfrm.name.focus();
	 return false;
  }
  if(document.loginfrm.pwd.value.length==0)
  {
    alert("请填写您的用户密码");
	document.loginfrm.pwd.focus();
	return false;
  }
}
function shownews(a)
{
   window.open("newspage.jsp?show="+a,"body","scrollbars=yes,width=500,height=500");
}
</script><head>
<style type="text/css">
<!-- @import url(images/main.css); -->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<title>EM购物广场</title>
<body bgColor=#63bce6 leftMargin=0 topMargin=0>
<table border=0 cellPadding=0 cellSpacing=0 width="100%">
  <tr><td vAlign=top width="60%">
      <table border=0 cellPadding=0 cellSpacing=0 width=770>
        <tr height=7 background="images/main_top_line.gif">
          <td colSpan=3 height=7></td></tr>
        <tr>
          <td background="images/main_left_line.gif" width=7></TD>
          <td vAlign=top>
            <table bgColor=#ffffff border=0 cellPadding=0 cellSpacing=0 width=756>
              <tr>
                <td>
                  <table border=0 cellPadding=0 cellSpacing=0 width=756>
                    <tr>
                      <td><%@ include file="top.jsp" %></td>
                    </tr></table></td></tr>
              <tr height=4>
                <td height=4></td></tr>
              <tr>
                <td>
                  <table border=0 cellPadding=0 cellSpacing=0 width=756>
                    <tr>
                      <td align=right vAlign=top width=168><%@ include file="left.jsp" %></td>
                      <td width=14></td>
                      <td vAlign=top width=574>
                        <table border=0 cellPadding=0 cellSpacing=0 width=564>
                          <tr>
                            <td>
							<%
							sql="select * from adpic where id='"+1+"'";
							rs=data.executeQuery(sql);
							rs.next();
							String adpic=rs.getString("pic");
							rs.close();
							%>
                              <table background="images/main_img_bg.gif" border=0 cellPadding=0 cellSpacing=0 height=260 width=564>
                                <tr>
                              <td vAlign=top><img border=0 height=255 src="ad/<%=adpic%>" width=561></td></tr></table></td></tr>
                          <tr height=7>
                            <td height=7></td></tr>
                          <tr>
                            <td vAlign=top></td></tr>
                            <td vAlign=top><iframe src="shopshow.jsp" frameborder="0" width="564" height="1100" scrolling="no"></iframe></td></tr>
                          <tr height=10>
                            <td height=10></td></tr>
                          <tr>
                            <td>
                              <table border=0 cellPadding=0 cellSpacing=0 width=564>
                                <tr>
                                <td>
                                <table bgColor=#e6e6e6 border=0 cellPadding=0 cellSpacing=1 width=295>
                                <tr>
                                <td bgColor=#ffffff vAlign=top>
                                <table bgColor=#f5f5f3 border=0 cellPadding=2 cellSpacing=3 width=293>
                                <tr>
                                <td bgColor=#ffffff vAlign=top>
                                <table border=0 cellPadding=0 cellSpacing=0 width=283>
                                <tr>
                                <td><img height=30 src="images/enews.gif" width=283></td></tr>
                                <tr height=3>
                                <td height=3></td></tr>
                                <tr>
                                <td vAlign=top>
                                <table width=283 height="150" border=0 cellPadding=0 cellSpacing=1 bgColor=#e6e6e6>
                                <tr bgColor=#ffffff>
                                <td vAlign=top>
								<table width="100%" height="128" border="0" align="center" cellpadding="0" cellspacing="0">
								<tr>
								<%
								sql="select top 2 * from news where nominate='"+"0"+"' and chkpic='"+"0"+"'";
								rs=data.executeQuery(sql);
								id=0;
								String title="";
								String pic="";
								while(rs.next())
								{
								  id=rs.getInt("id");
								  title=rs.getString("title");
								  String gettitle=title.substring(0,8);
								  pic=rs.getString("pic");
								%>								
								<td width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                    <tr>
                                                                      <td height="15"></td>
                                                                    </tr>
                                                                  </table> 
                                                                  <table width="100" border=0 cellPadding=0 cellSpacing=3 bgColor=#e6e6e6 align="center">
                                <tr> 
                                  <td bgColor=#ffffff><a href="javascript:shownews(<%=id%>)"><img src="news/<%=pic%>" width="100" height="90" border="0"></a></td>
                                </tr>
                              </table>
							  <table width="100" align="center" cellpadding="0" cellspacing="0" border="0">
							  <tr>
							  <td height="10"></td>
							  </tr>
							  </table>
                              <table border=0 cellPadding=0 cellSpacing=0 width="100%" align="center">
                                <tr> 
                                  <td bgColor=#ffffff class="diary"><a href="javascript:shownews(<%=id%>)"><div align="center"><font color=#1078ba><%=gettitle%>.....</font></div></a></td>
                                </tr>
                              </table>
								</td>
								<%}%>
								</tr>
								</table>
								</td>
                                </tr></table></td></tr></table></td></tr></table></td></tr></table></td>
                                <td align=right vAlign=top>
                                <table bgColor=#e6e6e6 border=0 cellPadding=0 cellSpacing=1 width=253>
                                <tr>
                                <td align=middle bgColor=#ffffff vAlign=top>
                                <table bgColor=#f5f5f3 border=0 cellPadding=2 cellSpacing=3 width=251>
                                <tr>
                                <td bgColor=#ffffff vAlign=top>
                                <table border=0 cellPadding=0 cellSpacing=0 width=240>
                                <tr>
                                <td><img height=30 src="images/link.gif" width=240></td></tr>
                                <tr height=3>
                                <td height=3></td></tr>
                                <tr><td>
								<table bgColor=#e6e6e6 border=0 cellPadding=0 cellSpacing=1 width=240>
								<tr>
								<td>
								<%
								sql="select top 6 id,name,link from link order by id desc";
								rs=data.executeQuery(sql);
								String name="";
								String link="";
								while(rs.next())
								{
								  name=rs.getString("name");
								  link=rs.getString("link");
								  %>
								  <table width=240 border=0 cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF" class=defaulttext>
                                                                          <td height=25 style="PADDING-LEFT: 5px" width=140> <a target="_blank" href=<%=link%>><%=link%></a></td>
                                  <td width=80><div align="center"><a target="_blank" href=<%=link%>><%=name%></a></div></td></tr></table>
								  <%}%>
						    </td></tr></table></td>
                      </tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr><tr>
                 <td>&nbsp;</td></tr></table></td></tr></table></td></tr></table></td>
              <td background="images/main_right_line.gif" width=7></td></tr>
          <tr height=7>
       <td background="images/main_bottom_line.gif" colSpan=3 height=7></td></tr></table></td>
    <td vAlign=top width="40%"><%@ include file="right.jsp" %></td></tr>
          <tr>
          <td height=40 align=middle class="blacktext"><div align="center">EM购物广场 TEL 
          0416-4177331<br>Copyright 2004 EMSHOP All right reserved.Contact webmast@emshop.com</div></td>
          <td>&nbsp;</td></tr></table></body>

⌨️ 快捷键说明

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