<%@language=VBScript.Encode codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="application.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
IF Trim(Request("action"))="Add" then
   LinkName  =repens(Trim(Request("LinkName")))
   LinkUrl=repens(Trim(Request("LinkUrl")))
   LinkFile=repens(Trim(Request("FileName")))
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from link where ID is null",conn,1,3
   Rs.addnew
      Rs("LinkName")=LinkName
	  Rs("LinkUrl")=LinkUrl
	  Rs("LinkFile")=LinkFile
	  Rs("AddDate")=now()
   Rs.update
   Rs.close:set Rs=nothing
   Response.Redirect("link.asp")
End If
%>
<script language = "JavaScript">
function CheckForm()
{
	if (document.myform.LinkName.value == "") {
		alert("链接名称没有填写.");
		document.myform.LinkName.focus();
		return false;
	}
	return true;    
	if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
    else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 
}
</script>
<!-- #include file="Inc/Head.asp" -->

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
   
    <td align="center" valign="top">
	<table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <form method="post" name="myform" onSubmit="return CheckForm();" action="LinkAdd.asp?action=Add">
          <tr> 
            <td class="back_southidc" height="30" colspan="3" align="center">增加友情链接</td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td width="125" height="25" align="right"><font color="#FF0000">*</font>链接名称：</td>
            <td colspan="2"> <input name="LinkName" type="text" class="input" size="30" maxlength="50">&nbsp;</td>
          </tr>
		  <tr bgcolor="#ECF5FF"> 
            <td width="125" height="25" align="right"><font color="#FF0000">*</font>链接地址：</td>
            <td colspan="2"> <input name="LinkUrl" type="text" class="input" size="30" maxlength="50">&nbsp;</td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="25" align="right"><font color="#FF0000">*</font>链接Logo：</td>
            <td width="235"> <input name="FileName" type="text" class="input" size="30"></td>
            <td width="580">&nbsp;<iframe frameborder="0" height="22" name="UpLoad" scrolling="no" src="Upload_Photo.asp"></iframe></td>
          </tr>
          <tr> 
            <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"> <input type="submit" name="Submit" value="提交" class="input">
              　 
              <input type="reset" name="Submit" value="重置" class="input"> </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->