link.asp
资源名称:1.rar [点击查看]
上传用户:ziqing_518
上传日期:2022-08-09
资源大小:446k
文件大小:5k
源码类别:
多媒体编程
开发平台:
ASP/ASPX
- <!--#include file="db/user.asp" -->
- <!--#include file="config.asp" -->
- <%
- if Request.QueryString("id")<>"" then
- set rs=conn.execute("select * from link where id="& Request.QueryString("id"))
- if rs("boolLinShow")=False then
- response.write("对不起,该友情连接未通过验证无法浏览")
- response.end
- else
- conn.execute("update link set numLinDown=numLinDown+1 where id="& Request.QueryString("id"))
- Response.Redirect rs("strLinUrl")
- end if
- end if
- %>
- <!--#include file="ubb.asp" -->
- <!--#include file="md5.asp" -->
- <!--#include file="function.asp" -->
- <!--#include file="top.asp" -->
- <%
- select case Request.QueryString("post")
- case "add"
- 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
- 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 &"',False,'"& now() &"')")
- Response.write("操作完成,2秒钟后返回<META HTTP-EQUIV=REFRESH CONTENT='2;URL=link.asp'>")
- response.end
- else
- %>
- <form name="linkForm" method="post" action="link.asp?post=add&save=ok">
- <table width="80%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000" align="center">
- <br>
- <tr align="center" bgcolor="#E4E4E4">
- <td colspan="2">申请友情连接</td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站名称:</td>
- <td width="70%"> <input name="strLinName" type="text" id="strLinName" size="20" maxlength="100" value=""> </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站地址:</td>
- <td width="70%"> <input name="strLinUrl" type="text" id="strLinUrl" size="40" maxlength="255" value="">(以 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=""> </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">网站介绍:</td>
- <td width="70%"> <textarea name="strLinTitle" cols="30" rows="5" id="strLinTitle"></textarea>
- </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">文字连接:</td>
- <td width="70%"> <input type="radio" name="boolLinText" value="True">
- 是
- <input type="radio" name="boolLinText" value="False" checked>
- 否(文字连接可以不填LOGO地址)</td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td width="30%">JS/Flash:</td>
- <td width="70%"> <input type="radio" name="boolLinJs" value="True">
- 是
- <input type="radio" name="boolLinJs" value="False" checked>
- 否(如果连接为JS代码或者Flash,请把代码直接填入网站介绍即可,其他可不填,文字连接选择否) </td>
- </tr>
- <tr align="center" bgcolor="#FFFFFF">
- <td colspan="2">
- <input type="submit" name="Submit" value="提交">
- </td>
- </tr>
- </table>
- </form>
- <%
- end if
- case else
- %>
- <table width="80%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000" align="center">
- <br>
- <tr bgcolor="#FFFFFF">
- <td align="center">
- <%
- Set rs =Server.CreateObject("ADODB.Recordset")
- sql="select * from link where boolLinText=False order by dateTimers desc"
- rs.open sql,conn,1,1
- if rs.eof then
- response.write("还没有LOGO友情连接")
- else
- do while not rs.eof
- if rs("boolLinJs")=True then
- response.write rs("strLinTitle")&" "
- else
- response.write("<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> ")
- end if
- i=i+1
- if i mod 5 =0 then
- response.write("<br><br>")
- end if
- rs.movenext
- loop
- end if
- rs.close
- set rs=nothing
- %>
- </td>
- </tr>
- </table>
- <%end select%>
- <br>
- <div align="center">
- <!--#include file="goal.asp" -->
- </div>
- </body>
- </html>