<!--#include file="conn/conn.asp"-->
<%
if session("username")="" or session("use_type")<>"超級管理員" then
response.Write("<script language='javascript'>alert('沒有足夠許可權,不能對網站檔案進行操作!');history.back();</script>")
response.end
end if
dim path,filename,filetype,fileconten,fso
path=request("path")
filename=html_encode(request("filename"))
filecontent=request("filecontent")
filetype=request("filetype")
if instr(filename,"*")>0 or instr(filename,"?")>0 or instr(filename,"&")>0 or len(filename)<0 or filename="" then
response.Write("<script language='javascript'>alert('非法的檔案名稱!');history.back();</script>")
response.end
else
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(path&filename&filetype) then
response.Write("<script language='javascript'>alert('檔案名稱己存,請重新選擇!');history.back();</script>")
response.End()
end if
set input=fso.createtextfile(server.mappath(path&filename&filetype),true)
input.writeline(filecontent)
input.close
if err then
response.Write("<script language='javascript'>alert('不可預料的錯誤!儲存檔案失敗!');history.back();</script>")
else
%>
<script language="">
var pathh="<%=replace(session("scriptname"),"","/")%>";
alert("檔案成功!");
window.location="try/mange_page.asp?pathh="+pathh;
</script>
<%
'response.redirect("try/mange_page.asp")
end if
end if
%>