<meta http-equiv="Content-Type" content="text/html; charset=gb2312">這行去掉后正常,
如果編碼為gb2312 顯示為空白,改成UTF-8出現錯誤,報未結束的字串常量
這不知道是什么原因?
希望老師們指點, 萬分感謝!
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="../inc/Fzwlt_AdminConn.asp"-->
<!--#include file="images/login/md5/md5.asp" -->
<!--#include file="images/login/md5/CFS.asp" -->
<%
if trim(request("OK"))="1" then
Response.Cookies("Fzwlt")("strUsername") = Trim(request("username"))
Response.Cookies("Fzwlt")("strPassword") = trim(request("password"))
Response.Cookies("Fzwlt")("OKCookie")=trim(request("OK"))
'Response.cookies("Fzwlt").expires=date+365
Response.Cookies("Fzwlt").Expires=DateAdd("y",30,Now())
%>
<%
Dim DBC,RsLoginObj,RsLogObj
Dim UserName,UserPass,VerifyCode,System,SqlLog,SqlLogin,Url
Url = Request("UrlAddress")
if Url = "" then
Url = "Fzwlt_MainFrame.asp"
end if
'Response.Write(Url)
'Response.End
UserName = Replace(Trim(Request.Form("UserName")),"'","''")
UserPass1 = CfsEnCode(Replace(Trim(Request.Form("Password")),"'","''"))
VerifyCode = Replace(Trim(Request("verifycode")),"'","")
UserPass=md5(UserPass1)
if UserName = "" or UserPass = "" then
Response.Redirect("Fzwlt_Errorp.asp?ErrDescription=用戶名和密碼不能為空!")
Response.End
end if
if Instr(request.form("UserName"),"=")>0 or Instr(request.form("UserName"),"%")>0 or Instr(request.form("UserName"),chr(32))>0 or Instr(request.form("UserName"),"?")>0 or Instr(request.form("UserName"),"&")>0 or Instr(request.form("UserName"),";")>0 or Instr(request.form("UserName"),",")>0 or Instr(request.form("UserName"),"'")>0 or Instr(request.form("UserName"),",")>0 or Instr(request.form("UserName"),chr(34))>0 or Instr(request.form("UserName"),chr(9))>0 or Instr(request.form("UserName"),"")>0 or Instr(request.form("UserName"),"$")>0 then
response.write"<script>alert('錯誤提示資訊!\n\n用戶名或密碼不能在非法字符!點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
response.End()
end if
if VerifyCode <> CStr(Session("GetCode")) then
response.write"<script>alert('錯誤提示資訊!\n\n驗證碼錯誤!點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
Response.End
end if
if request("verifycode")="" then
response.write"<script>alert('錯誤提示資訊!\n\n請輸入驗證碼!點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
Response.End
elseif Session("GetCode")="9999" then
Session("GetCode")=""
elseif Session("GetCode")="" then
response.write"<script>alert('錯誤提示資訊!\n\n請不要重復提交!點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
Response.End
elseif cstr(Session("GetCode"))<>cstr(trim(request("verifycode"))) then
response.write"<script>alert('錯誤提示資訊!\n\n你輸入的驗證碼和系統產生的不一致!點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
Response.End
end if
Session("GetCode")=""
set RsLoginObj = server.CreateObject ("ADODB.RecordSet")
SqlLogin = "select * from Fzwlt_Admin where UserName='"&UserName&"' and password='"&UserPass&"'"
RsLoginObj.Open SqlLogin,Conn,1,1
Session("Fzwlt_flag")=RsLoginObj("Fzwlt_flag")
Session("loginnos")=RsLoginObj("loginnos")
Session("loginip")=RsLoginObj("loginip")
Session("Csny")=RsLoginObj("Csny")
Conn.Execute("Update [Fzwlt_Admin] Set Csny='"&now()&"',loginnos=loginnos+1,loginip='"&Request.ServerVariables("REMOTE_ADDR")&"' Where UserName='"&UserName&"'")
System = Request.ServerVariables("HTTP_USER_AGENT")
if Instr(System,"Windows NT 5.0") then
System = "Win2000"
elseif Instr(System,"Windows NT 5.2") then
System="Win2003"
elseif Instr(System,"Windows NT 5.1") then
System = "WinXP"
elseif Instr(System,"Windows NT") then
System = "WinNT"
elseif Instr(System,"Windows 9") then
System = "Win9x"
elseif Instr(System,"unix") or instr(System,"linux") or instr(System,"SunOS") or instr(System,"BSD") then
System = "類Unix"
elseif Instr(System,"Mac") then
System = "Mac"
else
System = "Other"
end if
if Not RsLoginObj.EOF then
if RsLoginObj("Lock")=1 then
response.write"<script>alert('錯誤提示資訊!\n\n你的帳號已鎖定或無權進入!\n\n點擊確定回傳!');javascript:history.go(-1);</script>"
Response.End
end if
Session("UserName") = UserName
Session("PassWord") = UserPass
Session("AdminID") = RsLoginObj("AdminID")
Response.Cookies("Foosun")("UserName") = UserName
Response.Cookies("Foosun")("Password") = UserPass
Set RsLogObj = Server.Createobject("adodb.recordset")
SqlLog = "select * from Fzwlt_Log"
RsLogObj.open SqlLog,Conn,3,3
RsLogObj.addnew
RsLogObj("LogUser")=UserName
RsLogObj("LogIP")=request.ServerVariables("Remote_Addr")
RsLogObj("OS")=System
RsLogObj("Result") = 1
RsLogObj("Csny") = now()
RsLogObj.update
RsLogObj.close
set RsLogObj = Nothing
Response.Redirect(Url)
Response.End
else
set RsLogObj = Server.Createobject("adodb.recordset")
SqlLog = "select * from Fzwlt_Log"
RsLogObj.open SqlLog,Conn,3,3
RsLogObj.AddNew
RsLogObj("LogUser") = Request.Form("UserName")
RsLogObj("LogIP") = request.ServerVariables("Remote_Addr")
RsLogObj("OS") = System
RsLogObj("Errorpas") = Request.Form("Password")
RsLogObj("Result") = false
RsLogObj("Csny") = now()
RsLogObj.update
RsLogObj.close
set RsLogObj = Nothing
response.write"<script>alert('錯誤提示資訊!\n\n非法登錄, 請檢查用戶名和密碼的是否正確!\n\n點擊確定回傳重新輸入!');javascript:history.go(-1);</script>"
Response.End
end if
%>
uj5u.com熱心網友回復:
UTF-8 字多,有各種國家的語言,但是保存尺寸大,檔案臃腫;gb2312字少,只用中文和少數外語和符號,但是尺寸小,檔案小巧。
希望對你有幫助
uj5u.com熱心網友回復:
可以去網上看下UTF-8gb2312的區別
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/269336.html
標籤:ASP
上一篇:請教一個分析json資料的問題
下一篇:一個關于三點運算子的面試題
