index.asp
来自「这是一个网上购物物网站,数据库的连接在CONN.ASP中,既有前台网站,也有后台」· ASP 代码 · 共 323 行
ASP
323 行
<!--#include file="conn.asp"-->
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="image/css.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
.style1 {
COLOR: #333333
}
.style3 {COLOR: #333333; font-size: large;}
body {
margin-top: 10px;
}
.style8 {font-size: 12px}
.style9 {color: #FF0000}
</STYLE>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY leftMargin=0 marginwidth="0">
<TABLE class=table-1 cellSpacing=0 cellPadding=0 width=760 align=center
border=0>
<TBODY>
<TR vAlign=bottom>
<TD vAlign=center borderColor=#ffffff align=right width=174 bgColor=#ffffff
height=45 rowSpan=2>
<DIV align=center class=style3>
<div align="left"></div>
</DIV></TD>
<TD vAlign=center borderColor=#ffffff width=586 bgColor=#ffffff height=34><DIV align=right><a href="gouwu.asp?action=show"><IMG height=20
src="image/top_cart.gif" width=76 border=0></a><a href="user_index.asp"><IMG height=20
src="image/top_my.gif" width=76 border=0></a><a href="logout.asp"><img height=20
src="image/top_wh.gif" width=76 border=0></a></A> </DIV></TD></TR>
<TR vAlign=bottom>
<TD borderColor=#ffffff bgColor=#ffffff height=19> </TD>
</TR>
<TR>
<TD height=4 colSpan=2 borderColor=#ffffff><img src="image/1.jpg" width="760" height="3"></TD>
</TR>
<TR bgColor=#ff9900>
<th vAlign=top borderColor=#ffffff bgColor=#ffffff colSpan=2 height=19><div align="center">
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="left"><span class="style8"><a href="index.asp"> 首 页</a> <a href="news.asp">商品信息</a> <a href="oldgoods.asp"> 个人商品</a> <a href="newhuiyuan.asp">最新会员</a> </span></div></td>
</tr>
</table>
</div></th></TR></TBODY></TABLE>
<TABLE width=760
border=0 align=center cellPadding=0 cellSpacing=0 class="table-zuoyou">
<TBODY>
<TR>
<TD vAlign=top width=180>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD bgColor=#f1f1f1 height=23> <SPAN
class=style1>会员登陆</SPAN></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD height=41>
<DIV align=center>
<TABLE cellSpacing=1 cellPadding=1 width="95%" align=center
border=0>
<form id=Form1 name=form action=loginuser.asp method=post>
<TBODY>
<TR>
<TD align=middle height=98>
<TABLE cellSpacing=2 cellPadding=0 align=center border=0>
<TBODY>
<TR vAlign=center>
<TD align=middle height=20>用户名: </TD>
<TD>
<DIV align=left><INPUT class=wenbenkuang id=username
maxLength=12 size=12 name=username> </DIV></TD></TR>
<TR vAlign=center>
<TD align=middle>密 码: </TD>
<TD>
<DIV align=left><INPUT class=wenbenkuang id=userpassword
type=password maxLength=12 size=12 name=password>
</DIV></TD></TR>
<TR vAlign=center>
<TD align=middle><div align="center">
<INPUT class=go-wenbenkuang type=submit value=提交 name=Submit>
</div></TD>
<TD align=middle><div align="center">
<input class=go-wenbenkuang type=reset value=取消 name=Submit2>
</div></TD>
</TR></TBODY></TABLE>
<div align="center"><a href="reg.asp">注册会员</a>|<a href="forgetpwd.asp">忘记密码</a></div></TD></TR></form></TABLE>
</DIV></TD></TR></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<table width="100%" class="table-shangxia" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="23" bgcolor="f2f2f2"> 我的购物车</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="88%" border="0" cellpadding="0" cellspacing="0" align="center" height="63">
<%
if session("username")<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select count(*) as rec_count from act where username='"&session("username")&"' and zhuangtai=7",conn,1,1
rec_count=rs("rec_count")
rs.close
rs.open "select sum(zonger) as zongji from act where username='"&session("username")&"' and zhuangtai=7",conn,1,1
%>
<tr>
<td height="2" align=cneter></td>
</tr>
<tr>
<td height="20" align="center"> 有<font color=red><%=rec_count%></font>种商品在购物车内
</td>
</tr>
<tr>
<td height="20" align="center"> 总计¥:<font color=red><%=rs("zongji")%></font>元
</td>
</tr>
<tr>
<td height="8" align="center"></td>
</tr>
<tr>
<td height="20" align=center><a href="gouwu.asp?action=show">查看购物车/结帐>></a></td>
</tr>
<tr>
<td height="1" background="images/ppb.gif"></td>
</tr>
<%rs.close
set rs=nothing
else%>
<tr>
<td height="2" align=cneter></td>
</tr>
<tr>
<td height="20">
<div align="center">有<font color=red>0</font>种商品在购物车内<br>
总计¥:<font color=red>0</font>元</div>
</td>
</tr>
<tr>
<td height="1"></td>
</tr>
<%end if%>
</table>
</td>
</tr>
</table></TD></TR></TBODY></TABLE>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD bgColor=#f2f2f2 height=23> 商品分类</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center
border=0>
<TBODY>
<TR>
<TD height=6></TD></TR>
<TR>
<TD height=20>
<DIV align=center></DIV>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" height=22><table width=100% cellspacing="0" cellpadding="0" border="0">
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bigclass ",conn,1,1
if rs.recordcount=0 then
%>
<tr>
<td colspan=2 height="22">暂无分类</td>
</tr>
<%
else
i=0
while not rs.eof
%>
<tr>
<td align=right width=49% height="22" class="table-xia"><a href="shangpin.asp?bigclass=<%=rs("bigid")%>"><%=rs("bigclass")%></a></td>
<%rs.movenext
if rs.eof then
response.write "<td align=center> </td></tr>"
else
%>
<td align=left width=51% height="22" class="table-xia"> <font color="#666666">|</font> <a href="shangpin.asp?bigclass=<%=rs("bigid")%>"><%=rs("bigclass")%></a></td>
</tr>
<%
rs.movenext
end if%>
<%
wend
end if
%>
</table>
</TD>
</TR></TBODY></TABLE></TD></TR>
<TR>
<TD></TD></TR>
<TR>
<TD height=1></TD></TR>
<TR>
<TD height=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD class=table-zuoyou vAlign=top borderColor=#ffffff width=400
bgColor=#ffffff> <DIV align=center>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD width="83%" height=23 bgColor=#f2f2f2> 商品浏览</TD>
<TD width="17%" bgColor=#f2f2f2><a href="moregoods.asp">更多...</a></TD>
</TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY></TBODY></TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" height="139"><%set rs=conn.execute("select top 5 * from newgoods order by addtime desc")
i=0
do while not rs.eof and i<5 %>
<table width="100%" height="103" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="34%" height="112" rowspan="4" valign="bottom"> <img src="upload/<%=rs("img")%>" width="116" height="95" class="table-1" ></td>
<td width="66%" height="25" valign="bottom"><font color="#990000"><%=trim(rs("name"))%></font></td>
</tr>
<tr>
<td height="27" valign="bottom"><span class="style1">市场价:<s><font color=red><%=trim(rs("scprice"))%></font></s> 会员价:<font color=red><%=trim(rs("hyprice"))%></font><font color=red></font></span> </td>
</tr>
<tr>
<td height="24" valign="bottom"><a href="gouwu.asp?id=<%=rs("goodid")%>&action=add"><img src="image/goumai.gif" width="50" height="19" border=0></a> </td>
</tr>
<tr>
<td height="19" valign="bottom"><span class="table-xia"><font color="#999999">
<%if len(trim(rs("content")))>50 then
response.write left(trim(rs("content")),50)&"...."
else
response.write trim(rs("content"))
end if%>
</font></span></td>
</tr>
</table>
<%rs.movenext
i=i+1
loop
rs.close%></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY></TBODY></TABLE>
</DIV></TD>
<TD vAlign=top width=180>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD bgColor=#f1f1f1 height=23> 商品搜索</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=1 cellPadding=1 width="88%" align=center
border=0>
<FORM name=form2 action=search.asp method=get>
<TBODY>
<TR>
<TD align=middle> </TD>
</TR>
<TR>
<TD align=middle>关键字:
<INPUT name="key" type="text" class=wenbenkuang size=15 ;>
</TD>
</TR>
<TR>
<TD height=23 align=middle>
<div align="center">
<INPUT class=go-wenbenkuang type=submit value=查询商品 询 name=Submit>
</div> <div align="center">
</div></TD>
</TR>
<TR>
<TD height=23 align=middle> </TD>
</TR>
</FORM>
</TABLE>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD bgColor=#f2f2f2 height=23> 网站调查</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=154>
<TABLE cellSpacing=0 cellPadding=0 width="94%" border=0>
<TBODY>
<TR>
<TD align=left width="9%" height=141> </TD>
<TD align=left width="91%"><br><script language="JavaScript" src="vote/vote.asp?top=1"></script></TD>
</TR></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?