📄 admin_ubackup.asp
字号:
<%
'==================================
'=文 件 名:admin_ubackup.asp
'=适用版本:游戏天府WAP网站管理系统(CMS)V1.1
'=官方版权:http://www.gotf.cn
'=文件功能:数据库文件的还原管理
'=文件作者:游戏天府
'=发行时间:2007-02-01
'==================================
%>
<!--#include file="wapls_admin_conn.asp"-->
<!--#include file="wapls_admin_top.asp"-->
<%
if session("wapls_adminlogin")<>wapls_sessionvar then
errmsg="您没有登陆或不是管理员。请登陆。"
response.write "<script>window.alert('"&errmsg&"');window.location='admin_login.asp';</script>"
response.End
elseif cur_adminsuper<>1 then
errmsg=""&cur_adminname&",您不是超级管理员,没有权限进行此操作!"
response.write "<script>window.alert('"&errmsg&"');window.location='javascript:history.go(-1);';</script>"
response.End
end if
dim backpath,bkdbname,fso,folderpath,fso1,f
call main()
sub main()
if request("action")="Backup" then
call backupdata()
else
%>
<table cellspacing="1" cellpadding="4" align="center" class="tableborder" align="center">
<tr class="tablebody">
<td class="td_title" align="center">恢 复 数 据 库 !!!</td>
</tr>
<tr class="tablebody">
<td style="line-height:150%"><font color="#FF0000">注意:</font><br>
1、备份数据需要FSO组件支持,FSO组件的相关帮助!所有路径都是相对与程序空间根目录的相对路径!此功能谨慎使用,可能在有些空间备份后,在本机上不能用ACCESS打开。<br>
2、备份文件将会覆盖到原来的文件上!<br>
3、在进入此操作前,请确定网站现处于<font color="blue">维护状态</font>!
<br>
<form method="post" name="backupdb" action="?action=Backup">
<input type="hidden" name="backpath" value="<%=db%>">
<%
qqq=split(db,"/")
backupdir=qqq(0)&"/"&qqq(1)
%>
备份数据库的所在路径:<input type="txt" size="50" name="DBpath" value="<%=backupdir%>/Backup<%=year(date)%>-<%=month(date)%>#data/<%=qqq(2)%>">
<br>1、数据库的备份路径默认是原数据库的统一个文件夹下的/Backup月-日#date/数据库的名称<br>2、恢复数据请确定数据库文件的月份!
<p align="center"><input type="submit" name="submit" value="开始恢复"></p><br></td>
</tr>
<tr class="tablebody">
<td>您可以用这个功能来恢复您的数据库,以保证数据的安全!</td>
</tr>
</form>
</table>
<script>
function checkform()
{
document.backupdb.submit.disabled=true;
document.backupdb.submit.value="已提交";
return true;
}
var b=2;
document.backupdb.submit.disabled=true;
document.backupdb.submit.value="请确定网站目前处理维护状态";
for(i=1;i<=b;i++)
{window.setTimeout("update("+i+")",i*1000);}
function update(c){
if(c==b)
{
document.backupdb.submit.disabled=false;
document.backupdb.submit.value="开始恢复"
}
else{
a=b-c;
document.backupdb.submit.value="请确定网站目前处理维护状态";}
}
</script>
<%
end if
end sub
sub backupdata()
Dbpath=trim(request.form("Dbpath"))
backpath=trim(request.form("backpath"))
Dbpath=""&Dbpath
Dbpath=server.mappath(Dbpath)
backpath=""&backpath
backpath=server.mappath(backpath)
if backpath<>"" and dbpath<>"" then
Set Fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(dbpath) then
fso.copyfile Dbpath,Backpath
Response.Write "<script>"
Response.Write"alert('数据库恢复完成,请进行其他操作!\n建议使用 FTP 工具将数据库备份到本地电脑,以保证数据安全');"
Response.Write "</script>"
Response.Write"<script>history.go(-1)</script>"
else
Response.Write "<script>"
Response.Write"alert('找不到您所需要备份的文件!');"
Response.Write "</script>"
Response.Write"<script>history.go(-1)</script>"
end if
end if
end sub
%>
<!--#include file="wapls_admin_bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -