manage_link.asp

来自「烈火之家整站程序 本程序集商业娱乐一体,本来是给自己用的但是我的国外空间支持不够」· ASP 代码 · 共 126 行

ASP
126
字号
<!--#include file="admin.asp"-->
<!--#include file="conn.asp"-->
<%
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.ActiveConnection = Conn
Rs.Open "SELECT * FROM links Order BY id"

if Request.QueryString("no")="yes" then
id= Trim(Request("id"))
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.ActiveConnection = Conn
Rs.Open "DELETE FROM links Where id="&id,Conn,2,3,1


Set Rs= Nothing
Set Conn = Nothing
Response.Redirect "Manage_Link.asp"
end if



if Request.QueryString("no")="eshop" then
note=request.form("note")
link=request.form("link")
name=request.form("name")

If name=""Then
Response.Write("<script language=""JavaScript"">alert(""错误:您没输入网站名称,请返回检查!!"");history.go(-1);</script>")
response.end
end if


If link="" or link="http://" Then
Response.Write("<script language=""JavaScript"">alert(""错误:您没有输入超连接,请返回检查!!"");history.go(-1);</script>")
response.end
end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from links "
rs.open sql,conn,1,3
rs.addnew
rs("name")=name
rs("note")=note
rs("link")=link
rs.update
id=rs("id")
pic=request("pic")
txt=request("txt")
if pic="on" then conn.execute "update links set pic=true where id=" & id
if txt="on" then conn.execute "update links set txt=true where id=" & id
Response.Redirect"Manage_Link.asp"
response.end
end if
%>
<!-- #include file="../Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr class=a4> 
    <td align="center" valign="top">
      <table width="671" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="619" height="20"> <div align="center"><strong>友情链接管理</strong></div></td>
        </tr>
        <tr> 
          <form method="post" action="Manage_Link.asp?no=eshop">
            <td> <table width="80%" border="0" align="center" cellpadding="3" cellspacing="2">
                <tr> 
                  <td width="20%" height="22" bgcolor="#C0C0C0"> <div align="center">网站名称</div></td>
                  <td width="80%" bgcolor="#E3E3E3"><input type="text" name="name" size="35" maxlength="40"><br>
<input name="pic" type="checkbox">
                    [表示图标链接]
<input name="txt" type="checkbox" >[表示文字链接]
</td>
                </tr>
                <tr> 
                  <td height="22" bgcolor="#C0C0C0"><div align="center">网站logo</div></td>
                  <td bgcolor="#E3E3E3"><input type="text" name="note" size="50" maxlength="120" value="http://"></td>
                </tr>
                <tr> 
                  <td height="22" bgcolor="#C0C0C0"> <div align="center">连接地址</div></td>
                  <td bgcolor="#E3E3E3"><input type="text" name="link" size="60" maxlength="60" value="http://"></td>
                </tr>
                <tr bgcolor="#C0C0C0"> 
                  <td height="22" colspan="2"> <div align="center"> 
                      <input type="submit" name="Submit" value="提交">
                      <input type="reset" name="Submit2" value="重置">
                    </div></td>
                </tr>
              </table>
              <br> 
              <table width="100%" border="0" cellspacing="2" cellpadding="3">
                <tr bgcolor="#C0C0C0"> 
                  <td width="16%" height="25" bgcolor="#C0C0C0"><div align="center">网站名称</div></td>
                  <td width="35%" bgcolor="#C0C0C0"><div align="center">网站logo</div></td>
                  <td width="13%" bgcolor="#C0C0C0"><div align="center">文字链接</div></td>
                  <td width="12%" bgcolor="#C0C0C0"><div align="center">图片链接</div></td>
                  <td width="12%" bgcolor="#C0C0C0"><div align="center">加入时间</div></td>
                  <td width="12%" bgcolor="#C0C0C0"><div align="center">操作</div></td>
                </tr>
                <% do while not Rs.eof %>
                <tr bgcolor="#E3E3E3"> 
                  <td height="22" bgcolor="#E3E3E3"><div align="center"><a href="<%=Rs("link")%>" target="_blank"><%=rs("name")%></a></div></td>
                  <td bgcolor="#E3E3E3"><div align="center"><a href="<%=Rs("note")%>" target="_blank"><%=Rs("note")%></a></div></td>
                  <td bgcolor="#E3E3E3"><div align="center"><%=Rs("txt")%></div></td>
                  <td bgcolor="#E3E3E3"><div align="center"><%=Rs("pic")%></div></td>
                  <td bgcolor="#E3E3E3"><div align="center"><%= FormatDateTime(rs("time"),2) %></div></td>
                  <td bgcolor="#E3E3E3"><div align="center"><a href="Manage_Link.asp?id=<%=Rs("id")%>&amp;no=yes">删除</a></div></td>
                </tr>
                <%Rs.MoveNext 
loop 
%>
              </table>
              <%  Set Rs = Nothing 
Set Conn = Nothing 
%>
            </td>
          </form>
        </tr>
        <tr>
          <td height="22"><div align="right"><font color="#FF0000">首页最多可显示10条友情链接</font></div></td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- #include file="../Inc/Foot.asp" -->

⌨️ 快捷键说明

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