sk_config.asp

来自「1.支持文章」· ASP 代码 · 共 144 行

ASP
144
字号
<%
'********************************************************
'程序名称:小金通用采集系统
'版权所有:小金(qq:85103270)
%>
<!--#include file="inc/setup.asp"-->
<!--#include file="inc/md5.asp"-->
<link rel="stylesheet" type="text/css" href="css/Admin_Style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'----是否登陆
Call Admin()
If IsAdmin=false then
	ErrMsg="<li> 您没有登陆或不是管理员。请<a href='sk_login.asp' target='_top'>登陆</a>。"
	response.Redirect("Sk_err.asp?action=AdminErr&ErrMsg="&ErrMsg&"")
	response.End()
end if
'-----
Action=Trim(Request("Action"))
if action="save" then
	Set rspwd=conn.execute("select top 1 pwd from admin")
	if md5(Trim(Request.Form("pwd1")))=rspwd("pwd") then
		if Trim(Request.Form("pwd2"))=Trim(Request.Form("pwd3")) and Trim(Request.Form("pwd2"))<>"" and Trim(Request.Form("pwd3"))<>""then
		response.write "<script>alert('修改密码成功!');</script>"'关闭窗口
		conn.execute("update admin set pwd ='"& md5(Trim(Request.Form("pwd2"))) &"' where ID=5")
		End if
	End if
	rspwd.close
	set rspwd=nothing	
	call SaveEdit()
else
	call Main()'显示页面
end if

'关闭数据库链接
Call CloseConn()
Call CloseConnItem()

'保存
sub SaveEdit()
SqlItem="select top 1 WebName,WebUrl,WebLogo,Webabout,ArticleDir,flashdir,photoDir,alldir from SK_Config"
     	Set Rs=server.CreateObject("adodb.recordset")
     	Rs.Open SqlItem,Conn,3,3
		rs("WebName")=Request.Form("WebName")
		rs("WebUrl")=Request.Form("WebUrl")
		rs("WebLogo")=Request.Form("WebLogo")
		rs("Webabout")=Request.Form("Webabout")
		rs("ArticleDir")=Request.Form("ArticleDir")
		rs("flashdir")=Request.Form("flashdir")
		rs("photoDir")=Request.Form("photoDir")
		rs("allDir")=Request.Form("allDir")
		Rs.UpDate
      	Rs.Close	
	  	set rs=nothing 
    	call Main()
end sub
%>



<%Sub Main()
set rs = conn.execute("select top 1 WebName,WebUrl,WebLogo,Webabout,ArticleDir,flashdir,photoDir,alldir from SK_Config")
%>
<table width="97%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
<form action="?action=save" method="post">
  <tr>
    <td height="33" colspan="3" class="title"><div align="center"><span style="font-weight: bold">网站基本设置</span></div></td>
  </tr>
  <tr>
    <td colspan="3" class="title2">&nbsp;用于设置网站的基本信息。</td>
    </tr>
  
  <tr>
    <td class="table">&nbsp;网站全称</td>
    <td colspan="2" class="table"><input name="WebName"  type="text" id="WebName" class="lostfocus" gf="0" onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' onblur='this.className="lostfocus";this.gf="0"' onfocus='this.className="getfocus";this.gf="1"'  value="<% =rs("WebName") %> ">
      (显示于首页。如:“SK通用采集系统(skxiu)”)</td>
  </tr>
  <tr>
    <td width="18%" class="table">&nbsp;网站地址</td>
    <td width="82%" colspan="2" class="table"><input name="WebUrl" type="text" class="lostfocus" id="WebUrl" onfocus='this.className="getfocus";this.gf="1"' onblur='this.className="lostfocus";this.gf="0"' onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' value="<% =rs("WebUrl") %>" size="50" gf="0"></td>
  </tr>
  <tr>
    <td class="table">&nbsp;网站LOGO</td>
    <td colspan="2" class="table"><input name="WebLogo" type="text" id="WebLogo" value="<% =rs("WebLogo") %>" size="50" class="lostfocus" gf="0" onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' onblur='this.className="lostfocus";this.gf="0"' onfocus='this.className="getfocus";this.gf="1"'>      &nbsp;&nbsp;</td>
  </tr>
  
  
  <tr>
    <td class="table">&nbsp;密码修改</td>
    <td colspan="2" class="table"><p>
      <input name="pwd1" type="text" class="lostfocus" id="WebLogo2" onfocus='this.className=&quot;getfocus&quot;;this.gf=&quot;1&quot;' onblur='this.className=&quot;lostfocus&quot;;this.gf=&quot;0&quot;' onmouseover='this.className=&quot;getfocus&quot;' onmouseout='if (this.gf==&quot;0&quot;) this.className=&quot;lostfocus&quot;' value="" size="40" maxlength="50" gf="0" />
      输入原来密码<br />

        <input name="pwd2" type="text" class="lostfocus" id="WebLogo3" onfocus='this.className=&quot;getfocus&quot;;this.gf=&quot;1&quot;' onblur='this.className=&quot;lostfocus&quot;;this.gf=&quot;0&quot;' onmouseover='this.className=&quot;getfocus&quot;' onmouseout='if (this.gf==&quot;0&quot;) this.className=&quot;lostfocus&quot;' value="" size="40" maxlength="50" gf="0" />
        输入新密码<br />
        <input name="pwd3" type="text" class="lostfocus" id="WebLogo32" onfocus='this.className=&quot;getfocus&quot;;this.gf=&quot;1&quot;' onblur='this.className=&quot;lostfocus&quot;;this.gf=&quot;0&quot;' onmouseover='this.className=&quot;getfocus&quot;' onmouseout='if (this.gf==&quot;0&quot;) this.className=&quot;lostfocus&quot;' value="" size="40" maxlength="50" gf="0" />
        再输一次新密码
    </p></td>
  </tr>
  
  
  <tr>
    <td colspan="3" class="title2">&nbsp;</td>
  </tr>
  
  
  
  <tr>
    <td colspan="3" class="title"><div align="center" style="font-weight: bold">目录设置</div></td>
    </tr>
  <tr>
    <td colspan="3" class="title2">&nbsp;此设置应用于远程保存文件目录地址。<span class="table"></span></td>
    </tr>
  <tr>
    <td class="table">&nbsp;新闻文章目录</td>
    <td colspan="2" class="table"><input name="ArticleDir" type="text" class="lostfocus" id="ArticleDir" onfocus='this.className="getfocus";this.gf="1"' onblur='this.className="lostfocus";this.gf="0"' onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' value="<% =rs("ArticleDir") %>" gf="0">      
      <font class="alert">&nbsp;后面必须带"/"符号</font></td>
  </tr>
  
  <tr>
    <td class="table">&nbsp;图片目录</td>
    <td colspan="2" class="table"><input name="photoDir" type="text" class="lostfocus" id="PicDir" onfocus='this.className="getfocus";this.gf="1"' onblur='this.className="lostfocus";this.gf="0"' onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' value="<% =rs("photodir") %>" gf="0">
      <font class="alert">&nbsp;后面必须带"/"符号</font></td>
  </tr>
  <tr>
    <td class="table">自定采集目录</td>
    <td colspan="2" class="table"><input name="alldir" type="text" class="lostfocus" id="alldir" onfocus='this.className=&quot;getfocus&quot;;this.gf=&quot;1&quot;' onblur='this.className=&quot;lostfocus&quot;;this.gf=&quot;0&quot;' onmouseover='this.className=&quot;getfocus&quot;' onmouseout='if (this.gf==&quot;0&quot;) this.className=&quot;lostfocus&quot;' value="<% =rs("alldir") %>" gf="0" />
      <font class="alert">&nbsp;后面必须带&quot;/&quot;符号</font></td>
  </tr>
  
  
  
  
  
  <tr>
    <td height="50" colspan="3" class="title3"><div align="center">
      <input type="submit" name="Submit" value="提交">
    </div></td>
    </tr>
</form>
</table>
<%
end sub%>

⌨️ 快捷键说明

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