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

📄 item.asp

📁 用ASP写的二手市场程序
💻 ASP
字号:
<%
if not Request.ServerVariables("REMOTE_ADDR")=request.cookies("IPAddress") then
   response.cookies("IPAddress")=Request.ServerVariables("REMOTE_ADDR")

connstr = "DBQ="+server.mappath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
   Set DataConn = Server.CreateObject("ADODB.Connection")
   dataconn.open connstr
   Set rs = dataconn.execute("update data set num = num+1 WHERE id=" +Cstr(request("id")))  

end if
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="new.css" rel=stylesheet type=text/css>
<title>闽东二手交易中心</title>

</head>

<body>   
      <div align="center">
  <center>
  <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>        
      <td>        
        <table width="100%" border="0"  cellspacing="0" cellpadding="0">        
          <tr>        
            <td width="17%" bgcolor="#f0f0f0" valign="top"> 
 <!--#include file="bar_left.asp"-->         
</td>       
            <td width="83%" bgcolor="#ffffff" valign="top">
<!--text begin--> 
<br>
   <%
   on error resume next
   connstr = "DBQ="+server.mappath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
   Set DataConn = Server.CreateObject("ADODB.Connection")
   dataconn.open connstr
   Set rs = dataconn.execute("select * from data where ID= "+Cstr(request("ID"))+" order by id desc")

      response.write "<div align=center><TABLE width=450 cellPadding=0 cellSpacing=0 border=0 bordercolor=#ffffff valign=middle>"
      response.write "<tr><td>"
      response.write "<div align=center><TABLE width=100% border=0 cellPadding=0 cellSpacing=0 bordercolor=#ffffff valign=middle>"
      response.write "<tr><td>&nbsp;<font color=red>注意:</font>若想购买下列物品,请点击右边的图标获得进一步的信息.</td>"
      response.write "<td><p align=right><A href=deal.asp?ID="+cstr(rs("id"))+"><img src=deal.gif width=67 height=13 border=0></a>&nbsp;</P></td>"
      response.write "</tr></table></div>"
      response.write "</td></tr><tr><td>"
      response.write "<div align=center><TABLE width=100% border=1 bordercolor=#ffffff valign=middle>"
      response.write "<tr><TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;买 或 卖&nbsp;</td><td bgcolor=#fcfafc>"+Rs("buyorsell")+"</td></tr><tr>"  
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;登记日期&nbsp;</td><td bgcolor=#fcfafc>20"+cstr(rs("date"))+"&nbsp;"+cstr(rs("time"))+"</td></tr><tr>"
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;物品名称&nbsp;</td><td bgcolor=#fcfafc>"+Rs("goods")+"</td></tr><tr>"  
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;货物单价&nbsp;</td><td bgcolor=#fcfafc>"
      if len(Rs("price"))>0 then
      response.write +Rs("price")+" 元.¥</td></tr><tr>"    
else
      response.write +"货主未提供货物的价格,你可以与他(她)进行面议.</td></tr><tr>"    
end if

      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;货主姓名&nbsp;</td><td bgcolor=#fcfafc>"+Rs("name")+"</td></tr><tr>"
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;商品数量&nbsp;</td><td bgcolor=#fcfafc>"+Rs("amount")+" 个/件</td></tr><tr>"
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;购买日期&nbsp;</td><td bgcolor=#fcfafc>"+Rs("buydate")+"</td></tr><tr>"
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;新旧程度&nbsp;</td><td bgcolor=#fcfafc>"
      if len(Rs("degree"))>0 then
      response.write +Rs("degree")+" 成新</td></tr><tr>"    
else
      response.write +"? 成新</td></tr><tr>"
end if 
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;交易方式&nbsp;</td><td bgcolor=#fcfafc>"+Rs("trademode")+"</td></tr><tr>"  
      response.write "<td bgcolor=#f0f0f0 width=72 align=center>&nbsp;所在省份&nbsp;</td><td bgcolor=#fcfafc>"+Rs("province")+"</td></tr><tr>"
      response.write "<td bgcolor=#f0f0f0 width=72 align=center>&nbsp;所在城市&nbsp;</td><td bgcolor=#fcfafc>"+Rs("city")+"</td></tr><tr>"
      response.write "<TD bgcolor=#f0f0f0 width=72 align=center>&nbsp;货物描述&nbsp;</td><td bgcolor=#fcfafc>"+rs("content")+""
      response.write "</td></tr></table></div>"
      response.write "</td></tr></table></div>"
%>
<center><a href="javascript:window.external.AddFavorite('http://www.fafly.com/erso/item.asp?id=<%=cstr(rs("id"))%>', '<%=cstr(rs("goods"))%> - 闽东二手交易中心')"><b>添 加 该 物 品 到 收 藏 夹</b></a> 
</center>
            <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.lyr.value == "")
  {
    alert("请输入你的姓名!");
    theForm.lyr.focus();
    return (false);
  }

  if (theForm.lyr.value.length < 1)
  {
    alert("请输入你的姓名!");
    theForm.lyr.focus();
    return (false);
  }

  if (theForm.lyr.value.length > 100)
  {
    alert("在姓名输入框中,最多只能输入 100 个字符。");
    theForm.lyr.focus();
    return (false);
  }

  if (theForm.ly.value == "")
  {
    alert("请输入留言内容!");
    theForm.ly.focus();
    return (false);
  }

  if (theForm.ly.value.length < 1)
  {
    alert("请输入留言内容!");
    theForm.ly.focus();
    return (false);
  }
  return (true);
}
//--></script>
<!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="ly.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" webbot-action="--WEBBOT-SELF--">
              <!--webbot bot="SaveResults" U-File="../_private/form_results.txt"
              S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<hr height=1 width=100% color=f0f0f0>
<p><font color=336600><b>&nbsp; 给 货 主 留 言:</b></font></p>  
              <table border="0" width="100%"> 
                <tr> 
                  <td valign="top"> 
                    <div align="center"> 
                      <table border="0" cellspacing="0" cellpadding="0"> 
                        <tr> 
                          <td width="100%">你的姓名:<!--webbot
                            bot="Validation" B-Value-Required="TRUE"
                            I-Minimum-Length="2" I-Maximum-Length="100" --><input type="text" name="lyr" size="20" style="font-size: 9pt" maxlength="100">
                            <p> </p>
                            <p>留言内容:<br>
                            <!--webbot bot="Validation" B-Value-Required="TRUE"
                            I-Minimum-Length="1" --><textarea rows="9" name="ly" cols="27" style="font-size:9pt" ></textarea></p>
<input type="hidden" name="gid" value="<%=cstr(rs("id"))%>">
<input type="hidden" name="wpmc" value="<%=cstr(rs("goods"))%>">
<input type="hidden" name="hz" value="<%=cstr(rs("name"))%>">
<%
      Rs.close
      dataConn.close
%>
<br>
                            <p align="center"><input type="submit" value="提交" name="B1" style="font-size: 9pt">&nbsp;  
                            <input type="reset" value="重置" name="B2" style="font-size: 9pt"></td> 
                        </tr> 
                      </table> 
                    </div> 
                  </td> 
                  <td valign="top" >

<% 

  connstr = "DBQ="+server.mappath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
   Set DataConn = Server.CreateObject("ADODB.Connection")
   dataconn.open connstr
   Set rs = dataconn.execute("select * from ly where gid="+request("id")+" order by id desc") 
      if Rs.bof and Rs.eof then
             response.write "<p align=center>目前还没有留言.</p>"
      else
	           response.write "<ol>"
             do while not Rs.eof
	           response.write "<li>"
          	   response.write Rs("ly")+"<font color=336600>("+rs("lyr")+"于"+rs("lyrq")+")</font>"
          	   response.write "</li>"
          	   Rs.movenext
             loop
	           response.write "</ol>"
      end if
      Rs.close
      dataConn.close
%>

</td> 

                </tr> 
              </table> 
            </form> 

<!--text end--> 
<!--#include file="adv.htm"-->  </td>  
          </tr>   
       </td>                                                       
    </tr>                                                       
  </table>         
         
        </table>                                                       
                                                 
</div>                                                       
                                             </body>                                                       
                                                       
</html>                                                       

⌨️ 快捷键说明

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