modify_member.asp

来自「大家好」· ASP 代码 · 共 54 行

ASP
54
字号
<%@ Language=VBScript %>
<%
	function fixQuotes(theString)
			fixQuotes=Replace(theString,"'","''")
	end function
	DIM username,password
	username=Session("username")
	if username="" then 
		response.redirect "../syspages/error_InvalidReqest.htm"
	end if
	On Error Goto 0
	Set con=Server.CreateObject("ADODB.Connection")
	con.Open Application("DBCon_ConnectionString")
	'再次检查是否存在此用户,并得到有效值

	strSql="select yonghu,youxiao,zhuceriqi from yonghu where yonghu='"+username+"'"
	Set rs1=con.Execute(strSql)
	if rs1.EOF then
		response.redirect "../syspages/error_nothisuser.htm"
		'错误:没有这个用户
	end if
	'修改用户信息
	strSql="Update yonghu SET yonghu='"+fixQuotes(TRIM(username))
	strSql=strSql+"',kouling='"+fixQuotes(TRIM(Request.Form("kouling")))
	strSql=strSql+"',danwei='"+fixQuotes(TRIM(Request.Form("danwei")))
	strSql=strSql+"',guojia='"+fixQuotes(TRIM(Request.Form("guojia")))
	strSql=strSql+"',chengshi='"+fixQuotes(TRIM(Request.Form("chengshi")))
	strSql=strSql+"',dizhi='"+fixQuotes(TRIM(Request.Form("dizhi")))
	strSql=strSql+"',youbian='"+fixQuotes(TRIM(Request.Form("youbian")))
	strSql=strSql+"',lianxiren='"+fixQuotes(TRIM(Request.Form("lianxiren")))
	strSql=strSql+"',dianhua='"+fixQuotes(TRIM(Request.Form("dianhua")))
	strSql=strSql+"',e_mail='"+fixQuotes(TRIM(Request.Form("e_mail")))
	strSql=strSql+"',zhuye='"+fixQuotes(TRIM(Request.Form("zhuye")))
	strSql=strSql+"',youxiao="+cstr(rs1("youxiao"))
	strSql=strSql+" WHERE yonghu='"+Session("username")+"'"
	insertnum=0
	Set rs=con.Execute(strSql,insertnum)
	if insertnum>0 then
		'成功
		response.redirect "../syspages/sys_modifysuc.htm"
	else
		response.redirect "../syspages/error.htm"
	end if
	

%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?