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

📄 my_collection.asp

📁 购物网站源码有需要的赶快下载机不可失
💻 ASP
字号:
<!--#include file="top.asp"--><%usertopview%>
<%if userflag26=0 then
response.redirect"ok.asp?action=flag"
end if

if request("action")="save" then
'=============================================
SMT_sortid=request("SMT_sortid")
SMT_name=request("SMT_name")
SMT_collection=request("SMT_collection")

if left(SMT_collection,7)<>"http://" or len(SMT_collection)<10 then
errstyle="·对不起,请填写正确收藏地址!"
scripterr
end if

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_collection where SMT_yp_id="& session("id")
rs.open sql,conn,1,3
if userflag22<>0 then
if rs.recordcount >= cint(userflag22) then
errstyle="·您是"&vipshow&",只能上传最多 "&userflag22&" 个收藏地址!"
scripterr
end if
else
errstyle="·对不起,此功能已对"&vipshow&"关闭!"
scripterr
end if

rs.addnew
rs("SMT_sortid")=SMT_sortid
rs("SMT_name")=SMT_name
rs("SMT_collection")=SMT_collection
rs("SMT_yp_id")=session("id")
rs.update
rs.close
set rs=nothing
response.redirect"my_collection.asp"
'==============================================
elseif request("action")="del" then
conn.execute("delete From SMT_collection Where SMT_id="&request("id")&" and SMT_yp_id="&session("id"))
response.redirect"my_collection.asp?sortid="&request("sortid")&"&page="&request("page")&""
'=============================================
elseif request("action")="px" then

set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_collection where SMT_id="&request("id")&" and SMT_yp_id="&session("id")
rs.open sql,conn,1,3
rs("SMT_date")=now()
rs.update
rs.close
set rs=nothing
response.redirect"my_collection.asp?sortid="&request("sortid")&"&page="&request("page")&""

end if
%>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.SMT_name.value =="") {
alert("\操作错误,下面是产生错误的可能原因:\n\n·请输入收藏名称")
return false;
}
if( addform.SMT_collection.value =="") {
alert("\操作错误,下面是产生错误的可能原因:\n\n·请输入收藏地址")
return false;
}
return true;
}
// -->
</script>

<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="160" valign=top bgcolor=#efefef>
<!--==============-->
<!--#include file="left.asp"-->
<!--==============-->
</td>
<td width="600" valign=top>
<!--==============-->
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=25>您现在的位置是:我的公文包 > 我的收藏</td></tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor=#6C94D1>
  <tr>
    <td height=25 bgcolor=#6C94D1>  <font color=white>新增收藏</font></td>
  </tr>
  <tr>
    <td bgcolor=#ffffff height=25>
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<form name="addform" method="post" action="my_collection.asp?action=save" onSubmit="return checkdata()">
  <tr>
    <td align=center height=30><select name="SMT_sortid">
<option value=0 selected>不分类</option>
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_collection_sort where SMT_yp_id="&session("id")&" order by SMT_date desc"
rs.open sql,conn,1,1
do while not rs.eof%>
<option value=<%=rs("SMT_id")%>><%=rs("SMT_collection_sort")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing%></select> <a href=my_collection_sort.asp class=red>新分类</a> 收藏名称 <input name="SMT_name" type="text" size="10" maxlength="50"> 地址 <input name="SMT_collection" type="text" size="15" maxlength="50" value="http://"> <input type="submit" name="Submit" value="添加" class="input1"></td>
  </tr>
</form>
</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
  <tr>
    <td height=10></td>
  </tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="1" cellpadding="0"bgcolor=#6C94D1>
  <tr>
    <td height=25 bgcolor=#6C94D1 colspan=2 style="border:1px #6c94d1 solid">  <font color=white>收藏管理</font></td>
  </tr>
  <tr>
    <td width="19%" valign=top bgcolor="#ffffff">
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #cc3300 solid"><a href=my_collection.asp class=red>全部收藏</a></td></tr>
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #cc3300 solid"><a href=my_collection.asp?sortid=0>未分类</a></td></tr>
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_collection_sort where SMT_yp_id="&session("id")&" order by SMT_date desc"
rs.open sql,conn,1,1
do while not rs.eof%>
  <tr><td height=2></td></tr>
  <tr><td align="center" bgcolor=#efefef style="border-bottom:2px #cc3300 solid"><a href=my_collection.asp?sortid=<%=rs("SMT_id")%>><%=rs("SMT_collection_sort")%></a></td></tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
  <tr><td height=10></td></tr>
</table>
<!--======-->
	</td>
    <td width="81%" bgcolor=#ffffff valign=top>
<!--======-->
<table width="100%" border="0" cellspacing="0" cellpadding="5" align=center>
<%set rs=Server.CreateObject("Adodb.Recordset")
if request("sortid")<>"" then
sql="select * from SMT_collection where SMT_yp_id="&session("id")&" and SMT_sortid="&request("sortid")&" order by SMT_date desc"
else
sql="select * from SMT_collection where SMT_yp_id="&session("id")&" order by SMT_date desc"
end if
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "<tr><td height=194 colspan=6 align=center bgcolor=#ffffff>暂无内容</td></tr>"
else  
'分页的实现 
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
do while not rs.eof and i<listnum%>
<tr>
<td width="80%"><a href=<%=rs("SMT_collection")%> target=_blank><%=rs("SMT_name")%></a></td>
<td width="10%" align=center><a href=my_collection.asp?id=<%=rs("SMT_id")%>&action=px&sortid=<%=request("sortid")%>&page=<%=request("page")%>>排序</a></td>
<td width="10%" align=center><a href=my_collection.asp?id=<%=rs("SMT_id")%>&action=del&sortid=<%=request("sortid")%>&page=<%=request("page")%>>删除</a></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<%filename="my_collection.asp?sortid="&request("sortid")&""%>
<tr><td colspan=3 align=right bgcolor=#efefef height=20>共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>>|<<</a>
      <a href=<%=filename%>&page=<%=page-1%>><<</a>
      <a href=<%=filename%>&page=<%=page-1%>>[<%=page-1%>]</a>
<%end if%><% if Rs.pagecount=1 then %>
<%else%>[<%=page%>]
<%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>&page=<%=page+1%>>[<%=page+1%>]</a>
      <a href=<%=filename%>&page=<%=page+1%>>>></a>
      <a href=<%=filename%>&page=<%=Rs.pagecount%>>>>|</a>
	  <%end if%></td>
<%end if%></tr>

</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--==============-->
</td>
</tr>
</table>
<!--====== bottom ========-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor=#ffffff>
<tr><td height=2 bgcolor=#6C94D1></td></tr>
  <tr>
    <td align="center" height=80><%=citybottom%></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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