教你用ASP代碼寫文件記錄不用數(shù)據(jù)庫的實例代碼分享
作者: 來源: 發(fā)布時間:2011-6-17 11:43:53 點擊:
下面提供給大家一起學(xué)習(xí)分享的是教你用ASP代碼寫文件記錄不用數(shù)據(jù)庫的實例代碼,希望能給大家?guī)韼椭騿l(fā)。
<%
if request("action")="save" then
web_name=trim(request.form("web_name"))
web_url=trim(request.form("web_url"))
web_email=trim(request.form("web_email"))
web_keyword=trim(request.form("web_keyword"))
web_qq=trim(request.form("web_qq"))
set fso=Server.CreateObject("Scripting.FileSystemObject")
set zy=fso.CreateTextFile(Server.MapPath("config.asp"),True) '-----寫在 config.asp文件里面 !
zy.writeline "<"&chr(37)
zy.writeline "web_name="&chr(34)&""&web_name&""&chr(34)&""
zy.writeline "web_url="&chr(34)&""&web_url&""&chr(34)&""
zy.writeline "web_email="&chr(34)&""&web_email&""&chr(34)&""
zy.writeline "web_keyword="&chr(34)&""&web_keyword&""&chr(34)&""
zy.writeline "web_qq="&chr(34)&""&web_qq&""&chr(34)&""
zy.writeline chr(37)&">"
set zy=nothing
set fso=nothing
response.write"<script language='java script'>alert('設(shè)置成功!');location.href('?');</script>"
end if
%>
if request("action")="save" then
web_name=trim(request.form("web_name"))
web_url=trim(request.form("web_url"))
web_email=trim(request.form("web_email"))
web_keyword=trim(request.form("web_keyword"))
web_qq=trim(request.form("web_qq"))
set fso=Server.CreateObject("Scripting.FileSystemObject")
set zy=fso.CreateTextFile(Server.MapPath("config.asp"),True) '-----寫在 config.asp文件里面 !
zy.writeline "<"&chr(37)
zy.writeline "web_name="&chr(34)&""&web_name&""&chr(34)&""
zy.writeline "web_url="&chr(34)&""&web_url&""&chr(34)&""
zy.writeline "web_email="&chr(34)&""&web_email&""&chr(34)&""
zy.writeline "web_keyword="&chr(34)&""&web_keyword&""&chr(34)&""
zy.writeline "web_qq="&chr(34)&""&web_qq&""&chr(34)&""
zy.writeline chr(37)&">"
set zy=nothing
set fso=nothing
response.write"<script language='java script'>alert('設(shè)置成功!');location.href('?');</script>"
end if
%>
[收藏此文章]