asp 提交表单问题
不知道应该改哪里,无法提交到数据库中,帮忙看下。关键代码<%functionChangeChr(str)ChangeChr=replace(replace(replace...
不知道应该改哪里,无法提交到数据库中,帮忙看下。
关键代码
<%
function ChangeChr(str)
ChangeChr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")," "," ")
end function
%>
<%
dim action,Quarters
Quarters=trim(request.QueryString("Quarters"))
action=trim(request.QueryString("action"))
if action="add" then
Quarters=trim(request.Form("Quarters"))
Uname=trim(request.Form("Name"))
Sex=trim(request.Form("Sex"))
Marry=trim(request.Form("Marry"))
Birthday=trim(request.Form("Birthday"))
Stature=trim(request.Form("Stature"))
School=trim(request.Form("School"))
Studydegree=trim(request.Form("Studydegree"))
Specialty=trim(request.Form("Specialty"))
Gradyear=trim(request.Form("Gradyear"))
Residence=trim(request.Form("Residence"))
Edulevel=trim(request.Form("Edulevel"))
Edulevel=trim(ChangeChr(Edulevel))
Experience=trim(request.Form("Experience"))
Experience=trim(ChangeChr(Experience))
Phone=trim(request.Form("Phone"))
Mobile=trim(request.Form("Mobile"))
Email=trim(request.Form("Email"))
Add=trim(request.Form("Add"))
Postcode=trim(request.Form("Postcode"))
if School="" then
School=null
end if
if Studydegree="" then
Studydegree=null
end if
if Specialty="" then
Specialty=null
end if
if Gradyear="" then
Gradyear=null
end if
if Mobile="" then
Mobile=null
end if
if Add="" then
Add=null
end if
if Postcode="" then
Postcode=null
end if
'=================================
set rs=server.createobject("adodb.recordset")
sql="select * from HrDemandAccept where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("Quarters")=Quarters
rs("name")=Uname
rs("Sex")=Sex
rs("Marry")=Marry
rs("Birthday")=Birthday
rs("Stature")=Stature
rs("School")=School
rs("Studydegree")=Studydegree
rs("Specialty")=Specialty
rs("Gradyear")=Gradyear
rs("Residence")=Residence
rs("Edulevel")=Edulevel
rs("Experience")=Experience
rs("Phone")=Phone
rs("Mobile")=Mobile
rs("Email")=Email
rs("Add")=Add
rs("Postcode")=Postcode
rs("Adddate")=date()
rs.update
rs.close
set rs=nothing
response.write"<SCRIPT language=JavaScript>alert('您的简历提交成功,如果合适我们会尽快通知您面试!');"
response.write"javascript:history.go(-2)</SCRIPT>"
else
%>
<form action="HrDemandAccept.asp?action=add" method="post" name="form1" id="form1" onsubmit="return CheckJob()">
.....
</form> 展开
关键代码
<%
function ChangeChr(str)
ChangeChr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")," "," ")
end function
%>
<%
dim action,Quarters
Quarters=trim(request.QueryString("Quarters"))
action=trim(request.QueryString("action"))
if action="add" then
Quarters=trim(request.Form("Quarters"))
Uname=trim(request.Form("Name"))
Sex=trim(request.Form("Sex"))
Marry=trim(request.Form("Marry"))
Birthday=trim(request.Form("Birthday"))
Stature=trim(request.Form("Stature"))
School=trim(request.Form("School"))
Studydegree=trim(request.Form("Studydegree"))
Specialty=trim(request.Form("Specialty"))
Gradyear=trim(request.Form("Gradyear"))
Residence=trim(request.Form("Residence"))
Edulevel=trim(request.Form("Edulevel"))
Edulevel=trim(ChangeChr(Edulevel))
Experience=trim(request.Form("Experience"))
Experience=trim(ChangeChr(Experience))
Phone=trim(request.Form("Phone"))
Mobile=trim(request.Form("Mobile"))
Email=trim(request.Form("Email"))
Add=trim(request.Form("Add"))
Postcode=trim(request.Form("Postcode"))
if School="" then
School=null
end if
if Studydegree="" then
Studydegree=null
end if
if Specialty="" then
Specialty=null
end if
if Gradyear="" then
Gradyear=null
end if
if Mobile="" then
Mobile=null
end if
if Add="" then
Add=null
end if
if Postcode="" then
Postcode=null
end if
'=================================
set rs=server.createobject("adodb.recordset")
sql="select * from HrDemandAccept where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("Quarters")=Quarters
rs("name")=Uname
rs("Sex")=Sex
rs("Marry")=Marry
rs("Birthday")=Birthday
rs("Stature")=Stature
rs("School")=School
rs("Studydegree")=Studydegree
rs("Specialty")=Specialty
rs("Gradyear")=Gradyear
rs("Residence")=Residence
rs("Edulevel")=Edulevel
rs("Experience")=Experience
rs("Phone")=Phone
rs("Mobile")=Mobile
rs("Email")=Email
rs("Add")=Add
rs("Postcode")=Postcode
rs("Adddate")=date()
rs.update
rs.close
set rs=nothing
response.write"<SCRIPT language=JavaScript>alert('您的简历提交成功,如果合适我们会尽快通知您面试!');"
response.write"javascript:history.go(-2)</SCRIPT>"
else
%>
<form action="HrDemandAccept.asp?action=add" method="post" name="form1" id="form1" onsubmit="return CheckJob()">
.....
</form> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询