<!--#INCLUDE FILE="db_inc.asp"-->
<%
'=========================================================
' Version:1.0
' Date: 2005-6-29
' Design by 奇怪~` 
' QQ:373218510  
'=========================================================
' Copyright (C) 2004-2008 www.Sogotour.com. All rights reserved.
' HomePage: http://www.Sogotour.com
' Email: sogotour@163.com
'=========================================================
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<html>
<head>
<title>网易通自助友情链接系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="www.sogotour.com.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#525252">
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="3"><img src="images/top.gif" width="780" height="132" border="0" usemap="#Map"></td>
  </tr>
  <tr> 
    <td width="52"><img src="images/left.gif" width="52" height="600"></td>
    <td width="674" bgcolor="#FFFFFF">
      <%if request("action")="" then%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center"><iframe id="datamain" src="links.asp" width=674 height=500 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no ></iframe> 
            <layer visibility=hide> 
            <div style="width:674px;" align="right"> <a href="#" onMouseover="scrollspeed=-1" onMouseout="scrollspeed=0" style='TEXT-DECORATION: none;color:#ccc;font-family:Webdings'>5</a> 
              <a href="#" onMouseover="scrollspeed=1" onMouseout="scrollspeed=0" style='TEXT-DECORATION: none;color:#ccc;font-family:Webdings'>6</a> 
            </div>
            </layer>
<script LANGUAGE="JavaScript">
<!-- hide
function goHist(a) {
   history.go(a);
}
//-->
</script></td>
        </tr>
      </table><br>
<%elseif request("action")="addlink" then
function linkaddkey()
randomize timer
linkaddkey=1000+int(rnd*999)
end function
%>

      <table width="86%" border="0" align="center" cellpadding="8" cellspacing="0">
        <tr> 
          <td> <img src="images/Topics.gif" width="23" height="21" align="absmiddle"><font color="#999999"><b>以下所有项目都必须填写</b></font></td>
        </tr>
      </table>
      <table width=86% align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#00CCFF><tr><td bgcolor=#FFFFFF><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#F3F3F3">
              <form action="?action=add" method="post">
                <tr> 
                  <td height="30" colspan="2" bgcolor="#00CCFF"><font color="#FFFFFF">　　&raquo; 
                    <b>添加友情链接</b></font></td>
                </tr>
                <tr> 
                  <td align="right">　<br>
                    　网站名称： </td>
                  <td><br> <input name="t1" type="text" id="t1" value="" size="36" maxlength="36"> 
                    <font color="#999999">3-36字</font><font color="#FF0000">*</font> 
                    <label> </label> </td>
                </tr>
                <tr> 
                  <td align="right">链接类型： </td>
                  <td><label> 
                    <input name="logoortxt" type="radio" value="0" checked>
                    图片链接</label> <label> 
                    <input type="radio" name="logoortxt" value="1">
                    文字链接</label> <font color="#FF0000">*</font> </td>
                </tr>
                <tr> 
                  <td align="right">　　连接地址： </td>
                  <td><input name="t2" type="text" id="t2" value="http://" size="50" maxlength="100"> 
                    <font color="#FF0000">*</font></td>
                </tr>
                <tr> 
                  <td align="right">　　logo图标： </td>
                  <td><input name="t3" type="text" id="t3" value="http://" size="55" maxlength="160"> 
                    <font color="#FF0000">*</font></td>
                </tr>
                <tr> 
                  <td width="84" align="right" valign="top">站点说明：</td>
                  <td width="471"><textarea name="t4" cols="58" rows="5" id="t4"></textarea> 
                    <font color="#FF0000">*</font></td>
                </tr>
                <tr> 
                  <td align="right" valign="top">验证码：</td>
                  <td width="471"><input name="keys" type="text" id="keys" size="4" maxlength="4">
                    <%session("key")=linkaddkey()%>
                    <b><font color="#666666" size="3" face="Microsoft Sans Serif"><%=session("key")%></font></b></td>
                </tr>
                <tr> 
                  <td> <div align="right"> </div></td>
                  <td><p> 
                      <input type="submit" name="Submit" value=" 确定添加 ">
                      <input type="reset" name="Submit" value=" 重新填写 ">
                    </p>
                    <p>　</p></td>
                </tr>
              </form>
            </table></td></tr></table>
<%
'添加
elseif request("action")="add" then 
key1=""&session("key")&"" 
key2=""&request("keys")&"" 
if key1<>key2 then
response.write"<script>alert('很抱歉，验证码输入错误！~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
end if

if request("t1")="" or len(request("t1"))>36 or len(request("t1"))<2 or request("t2")="" or request("t3")="" or left(request("t2"),7)<>"http://" or len(request("t2"))<12 or len(request("t2"))>100 or left(request("t3"),7)<>"http://" or len(request("t3"))>160 or len(request("t3"))<16 or request("t4")="" or len(request("t4"))>255 or len(request("t4"))<2  then
response.write"<script>alert('很抱歉，请正确、完整的填写链接信息！~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
end if

StrSql = "select * from sogo_link"
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs.addnew
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("t3")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
session("key")=""
rs.update
rs.close
response.write"<table width=86% border=0 align=center cellpadding=8 cellspacing=0><tr><td><img src=images/Topics.gif width=23 height=21 align=absmiddle><b><font color=#FF9900>添加友情链接成功！</font></b></td></tr></table><table width=86% align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#00CCFF><tr><td bgcolor=#FFFFFF><table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=#F3F3F3><tr><td height=25 align=left bgcolor=#00CCFF><font color=#ffffff>　&raquo; <b>提示信息</b></font></td></tr><tr><td>"
response.write"<li>此链接需待管理员审核！</li><li>请按<a href=index.asp><u>这里</u></a>返回到友情链接显示页面</li></td></tr></table></td></tr></table><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"
end if
%>		  
</td>
    <td width="54"><img src="images/right.gif" width="54" height="600"></td>
  </tr>
  <tr> 
    <td colspan="3"><img src="images/bottom.gif" width="780" height="52" border="0" usemap="#Map2"></td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="511,90,575,108" href="index.asp">
  <area shape="rect" coords="593,90,656,108" href="index.asp?action=addlink">
  <area shape="rect" coords="672,90,721,108" href="admin.asp">
</map>
<map name="Map2">
  <area shape="rect" coords="459,7,678,27" href="http://sogotour.com/index.asp" target="_blank">
</map>
</body>
</html>