感谢昨天版主高手们为我简化代码,现在又有一段看能简化不?
由于刚学asp 用的都是笨的代码写法 像以上看起来一大堆又长,希望版主们或高手支招我现在只能慢慢的向你们学高一点的层次学习拉!呵呵!可不要见怪!我就是爱学!
程序代码:
<% if session("adminlogin")<>sessionvar then response.Write "权限不足" response.end end if Server.ScriptTimeOut=5000 %> <% if request("action")="modify" then pass=request.Form("pass") pass1=request.Form("pass1") pass2=request.Form("pass2") password=request.Form("passd") name=request.Form("name") link=request.Form("link") link_target=request.Form("link_target") description=request.Form("description") logo_id=request.Form("logo_id") logo_alpha=request.Form("logo_alpha") plugins=request.Form("plugins") backgrounds=request.Form("backgrounds") bg=request.Form("bg") skin=request.Form("skin") skins=request.Form("skins") skin_id=request.Form("skin_id") lists=request.Form("lists") list_delete=request.Form("list_delete") auto_play=request.Form("auto_play") play_id=request.Form("play_id") play_mode=request.Form("play_mode") mixer_id=request.Form("mixer_id") mixer_color=request.Form("mixer_color") mixer_displace=request.Form("mixer_displace") mixer_filter=request.Form("mixer_filter") src_handler=request.Form("src_handler") lrc_handler=request.Form("lrc_handler") bg_video=request.Form("bg_video") bg_lrc=request.Form("bg_lrc") plugins_disabled=request.Form("plugins_disabled") context_menu=request.Form("context_menu") default_skin=request.Form("default_skin") counter=request.Form("counter") src=request.Form("src") lrc=request.Form("lrc") label=request.Form("label") type_id=request.Form("type_id") other=request.Form("other") bgmclass=request.Form("bgmclass") if pass<> pass then r="no" response.write "<script language=javascript>" response.write "alert('原来的密码不正确啊??');" response.write "</script>" response.write "<script language=javascript>location='javascript:history.back(1)'</script>" Response.End end if if pass="" then r="no" response.write "<script language=javascript>" response.write "alert('请填写原来的密码才能确定成功');" response.write "</script>" response.write "<script language=javascript>location='javascript:history.back(1)'</script>" Response.End end if if pass1<>"" and pass2 <> "" then if pass1 <> pass2 then r="no" response.write "<script language=javascript>" response.write "alert('两个密码填写不一样!!');" response.write "</script>" response.write "<script language=javascript>location='javascript:history.back(1)'</script>" Response.End else p="yes" end if end if if r<>"no" then sql="select * from admin where username='"&user&"'" Set rs3=Server.CreateObject("ADODB.RecordSet") rs3.open sql,conn,1,3 if p="yes" then pass=md5(pass1) rs3("password")=pass end if rs3("name")=name rs3("link")=link rs3("link_target")=link_target rs3("description")=description rs3("logo_id")=logo_id rs3("logo_alpha")=logo_alpha rs3("plugins")=plugins rs3("backgrounds")=backgrounds rs3("bg")=bg rs3("skin")=skin rs3("skins")=skins rs3("skin_id")=skin_id rs3("lists")=lists rs3("list_delete")=list_delete rs3("auto_play")=auto_play rs3("play_id")=play_id rs3("play_mode")=play_mode rs3("mixer_id")=mixer_id rs3("mixer_color")=mixer_color rs3("mixer_displace")=mixer_displace rs3("mixer_filter")=mixer_filter rs3("src_handler")=src_handler rs3("lrc_handler")=lrc_handler rs3("bg_video")=bg_video rs3("bg_lrc")=bg_lrc rs3("plugins_disabled")=plugins_disabled rs3("context_menu")=context_menu rs3("default_skin")=default_skin rs3("counter")=counter rs3("src")=src rs3("lrc")=lrc rs3("label")=label rs3("type_id")=type_id rs3("other")=other rs3("bgmclass")=bgmclass rs3.update rs3.close end if end if%>