link.asp
资源名称:1.rar [点击查看]
上传用户:ziqing_518
上传日期:2022-08-09
资源大小:446k
文件大小:10k
源码类别:
多媒体编程
开发平台:
ASP/ASPX
- <!--#include file="users.asp" -->
- <!--#include file="config.asp" -->
- <!--#include file="../md5.asp" -->
- <!--#include file="cookies.asp" -->
- <%
- if rs4("boolLink")=False then
- Response.Redirect "index.asp"
- end if
- end if
- rs.close
- set rs=nothing
- end if
- %>
- <!--#include file="function.asp" -->
- <!--#include file="code.asp" -->
- <!--#include file="first.asp" -->
- <table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>
- <tr>
- <td width=185 valign=top>
- <!--#include file="inc.asp" -->
- </td>
- <td width=550 valign=top>
- <%
- if Request.Form("do")<>"" then
- select case Request.Form("do")
- case "del"
- conn.execute("delete from [link] where id in ("&replace(request.form("id"),"'","")&")")
- case "bool"
- conn.execute("update [link] set boolLinShow=True where id in ("&replace(request.form("id"),"'","")&")")
- end select
- Response.write("操作完成,2秒钟后返回<META HTTP-EQUIV=REFRESH CONTENT='2;URL=link.asp'>")
- response.end
- end if
- if Request.QueryString("save")="ok" then
- if Request.Form("boolLinJs")="False" then
- if Request.Form("strLinName")<>"" then
- strLinName=Request.Form("strLinName")
- else
- MsgErrLink=MsgErrLink&"<li>网站名称不能为空"
- end if
- if Request.Form("strLinUrl")<>"" then
- strLinUrl=Request.Form("strLinUrl")
- else
- MsgErrLink=MsgErrLink&"<li>网站地址不能为空"
- end if
- if Request.Form("strLinTitle")<>"" then
- strLinTitle=Request.Form("strLinTitle")
- else
- MsgErrLink=MsgErrLink&"<li>网站介绍不能为空"
- end if
- if Request.Form("boolLinText")="True" then
- strLinPic=""
- else
- if Request.Form("strLinPic")<>"" then
- strLinPic=Request.Form("strLinPic")
- else
- MsgErrLink=MsgErrLink&"<li>如果不是文本连接,LOGO地址不能为空"
- end if
- end if
- else
- strLinName=""
- strLinUrl=""
- boolLinText=False
- strLinPic=""
- if Request.Form("strLinTitle")<>"" then
- strLinTitle=Request.Form("strLinTitle")
- else
- MsgErrLink=MsgErrLink&"<li>如果是JS或者FLASH代码,请将代码填入网站介绍内,其他可不必填写"
- end if
- end if
- if MsgErrLink<>"" then
- response.write MsgErrLink
- response.end
- end if
- select case Request.QueryString("post")
- case "add"
- conn.execute("insert into link(strLinName,strLinUrl,boolLinText,boolLinJs,numLinDown,strLinTitle,strLinPic,boolLinShow,dateTimers) values('"& strLinName &"','"& strLinUrl &"',"& Request.Form("boolLinText") &","& Request.Form("boolLinJs") &",0,'"& strLinTitle &"','"& strLinPic &"',True,'"& now() &"')")
- case "edit"
- conn.execute("update link set strLinName='"& strLinName &"',strLinUrl='"& strLinUrl &"',boolLinText="& Request.Form("boolLinText") &",boolLinJs="& Request.Form("boolLinJs") &",strLinTitle='"& strLinTitle &"',strLinPic='"& strLinPic &"' where id="& Request.QueryString("id"))
- case else
- response.write("程序出现错误,请检测你的操作")
- response.end
- end select
- Response.write("操作完成,2秒钟后返回<META HTTP-EQUIV=REFRESH CONTENT='2;URL=link.asp'>")
- response.end
- else
- if Request.QueryString("post")="del" then
- conn.execute("delete from link where id="& Request.QueryString("id"))
- Response.write("操作完成,2秒钟后返回<META HTTP-EQUIV=REFRESH CONTENT='2;URL=link.asp'>")
- response.end
- elseif Request.QueryString("post")="edit" then
- strName="编辑连接"
- strAction="link.asp?id="& Request.QueryString("id") &"&post=edit&save=ok"
- set rs=conn.execute("select * from link where id="& Request.QueryString("id"))
- strLinName=rs("strLinName")
- strLinUrl=rs("strLinUrl")
- strLinPic=rs("strLinPic")
- strLinTitle=rs("strLinTitle")
- boolLinText=rs("boolLinText")
- if boolLinText=True then
- boolLinTexta="checked"
- else
- boolLinTextb="checked"
- end if
- boolLinJs=rs("boolLinJs")
- if boolLinJs=True then
- boolLinJsa="checked"
- else
- boolLinJsb="checked"
- end if
- else
- strName="添加连接"
- strAction="link.asp?post=add&save=ok"
- strLinName=""
- strLinUrl=""
- strLinPic=""
- strLinTitle=""
- boolLinTextb="checked"
- boolLinJsb="checked"
- end if
- end if
- %>
- <form name="linkForm" method="post" action="<%=strAction%>">
- <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
- <tr align="center" bgcolor="#E4E4E4">
- <td colspan="2"><%=strName%></td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站名称:</td>
- <td width="70%"> <input name="strLinName" type="text" id="strLinName" size="20" maxlength="100" value="<%=strLinName%>"> </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站地址:</td>
- <td width="70%"> <input name="strLinUrl" type="text" id="strLinUrl" size="40" maxlength="255" value="<%=strLinUrl%>">(以 http:// 开头) </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">LOGO地址:</td>
- <td width="70%"> <input name="strLinPic" type="text" id="strLinPic" size="40" maxlength="255" value="<%=strLinPic%>"> </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站介绍:</td>
- <td width="70%"> <textarea name="strLinTitle" cols="30" rows="5" id="strLinTitle"><%=strLinTitle%></textarea>
- </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">文字连接:</td>
- <td width="70%"> <input type="radio" name="boolLinText" value="True" <%=boolLinTexta%>>
- 是
- <input type="radio" name="boolLinText" value="False" <%=boolLinTextb%>>
- 否(文本连接可以不填LOGO地址)</td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">JS/Flash:</td>
- <td width="70%"> <input type="radio" name="boolLinJs" value="True" <%=boolLinJsa%>>
- 是
- <input type="radio" name="boolLinJs" value="False" <%=boolLinJsb%>>
- 否(如果连接为JS代码或者Flash,请把代码直接填入网站介绍即可,其他可不填,本文连接选择否) </td>
- </tr>
- <tr align="center" bgcolor="#FFFFFF">
- <td colspan="2">
- <input type="submit" name="Submit" value="提交">
- </td>
- </tr>
- </table>
- </form>
- <form name="LinkPostForm" method="post" action="link.asp">
- <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
- <tr>
- <td bgcolor="#D4D4D4" align="center">友情连接
- </td>
- </tr>
- </table><br>
- <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
- <%
- if request.QueryString("page")<>"" then
- absPageNum=request.QueryString("page")
- else
- absPageNum=1
- end if
- Set rs =Server.CreateObject("ADODB.Recordset")
- rs.CursorType = adOpenStatic
- rs.CacheSize = 20
- sql="select * from link order by dateTimers desc"
- rs.open sql,conn,1,1
- RecordPerPage= 20
- rs.PageSize = RecordPerPage
- Tol = rs.PageCount
- If Not(rs.EOF) Then
- rs.AbsolutePage = absPageNum
- End If
- if rs.eof then
- response.write("<tr align=""center"" bgcolor=""#F0F0F0""><td>还没有友情连接,请添加↑</td></tr>")
- else
- response.write("<tr align=""center"" bgcolor=""#F0F0F0"">")
- for i = 1 to 20
- if rs.eof then
- response.write("<td width=""25%""> </td>")
- else
- if rs("boolLinJs")=True then
- response.write("<td width=""25%"">"& rs("strLinTitle") &"<br>")
- else
- if rs("boolLinText")=False then
- response.write("<td width=""25%""><a href="""& rs("strLinUrl") &""" target=""_blank""><img src="""& rs("strLinPic") &""" alt=""网站名称:"& rs("strLinName") &"<br>加入时间:"& rs("dateTimers") &"<br>点 击 数:"& rs("numLinDown") &"<br>网站介绍:"& rs("strLinTitle") &""" border=""0""></a><br>")
- else
- response.write("<td width=""25%""><a href="""& rs("strLinUrl") &""" target=""_blank"" alt=""加入时间:"& rs("dateTimers") &"<br>点击数:"& rs("numLinDown") &"<br>网站介绍:"& rs("strLinTitle") &""">"& rs("strLinName") &"</a><br>")
- end if
- end if
- response.write("<input type=""checkbox"" name=""id"" value="""& rs("id") &""">"& vbCRLF & _
- "<a href=link.asp?id="& rs("id") &"&post=del><img src=""../images/delfolder.gif"" width=""20"" height=""16"" align=""absmiddle"" alt=""删除"" border=""0"" onclick=""{if(confirm('您确定执行的操作吗?')){return true;}return false;}""></a><a href=link.asp?id="& rs("id") &"&post=edit><img src=""../images/send.gif"" width=""20"" height=""16"" align=""absmiddle"" alt=""编辑"" border=""0""></a>")
- if rs("boolLinShow")=False then
- response.write("<img src=""../images/filtermail.gif"" width=""20"" height=""16"" align=""absmiddle"" alt=""该友情连接还未通过验证,无法显示"" border=""0""></td>")
- end if
- rs.movenext
- end if
- if i mod 4=0 and i<>20 then
- response.write("</tr><tr align=""center"" bgcolor=""#F0F0F0"">")
- end if
- next
- end if
- %>
- </tr>
- </table><br>
- <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
- <tr>
- <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="35%">
- <input type="radio" name="do" value="del">
- 删除
- <input type="radio" name="do" value="bool">
- 通过验证
- <input type="submit" name="Submit" value="提交" onclick="{if(confirm('您确定执行的操作吗?')){return true;}return false;}">
- </td>
- <td width="65%" align="right"><%
- strSelectPage=("<option value='link.asp' selected>请选择</option>")
- for i=1 to Tol
- strSelectPage=(strSelectPage&"<option value='link.asp?page="&i&strPage&"'>第"&i&"页</option>")
- next
- response.write("当前页:[<font color='#FF0000'><strong>"&absPageNum&"</strong></font>] 共 <font color='#FF0000'><strong>"&Tol&"</strong></font> 页 每页:[<font color='#FF0000'><strong>"&RecordPerPage&"</strong></font>] 转到 <select name='select2' onChange='window.location=form.select2.options[form.select2.selectedIndex].value' size=1>"&strSelectPage&"</select> 页")
- %>
- </td>
- </tr>
- </table></td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- <br><hr width=735>
- <center>