日期:2014-05-17  浏览次数:20942 次

表单处理出问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
if session("checked")<>"yes" then
response.Redirect "guanli.asp"

%>

<%
else
%>

<%
  if Request.QueryString("input")<>2 then
  response.Redirect "guanli.asp"
%>
<%
  else
mingzi=trim(request("Tname"))
zhiwei=trim(request("job"))
gongsi=trim(request("Company"))
youjian=trim(request("Email"))
dianhua=trim(request("Tel"))
chuanzhen=trim(request("Fax"))
shouji=trim(request("Mobile"))
set rs=server.createobject("adodb.recordset")
sql="insert into jiben(mingzi,zhiwei,gongsi,youjian,dianhua,chuanzhen,shouji) values('"&mingzi&"','"&zhiwei&"','"&gongsi&"','"&youjian&"','"&dianhua&"','"&chuanzhen&"','"&shouji&"')"
rs.Open sql,conn,1,1
set rs=nothing
rs.close
xingqu=request.Form("Q1")
other1=trim(request("Q1Ans"))
set rs1=server.createobject("adodb.recordset")
sql1="insert into xingqu(xingqu,other) values('"&xingqu&"','"&other1&"')"
rs1.open sql1,conn,1,1
set rs1=nothing
rs1.close
hangye=request.Form("Q2")
other2=tirm(request("Q2Ans"))
guimo=trim(request("Q3"))
set rs2=server.createobject("adodb.recordset")
sql2="insert into hangye(hangye,other,guimo) values('"&hangye&"','"&other2&",'"&guimo&"')" '在这里浏览器提示语句未结束rs2.open sql2,conn,1,1
set rs2=nothing
rs2.close
weilai=request.Form("Q4")
other3=trim(request("Q4Ans"))
yusuan=trim(request("Q5"))
jihui=request.Form("Q6")
set rs3=server.createobject("adodb.recordset")
sql3="insert into weilai(weilai,other,yusuan,jihui) values('"&weilai&"','"&other3&"','"&yusuan&"','"&jihui&"')"
rs3.open sql3,conn,1,1
set rs3=nothing
rs3.close
response.write "<script language='javascript'>"
response.write "alert('信息添加成功!');"
response.write "window.location.href = 'guanli.asp'" '这里要做修改
response.write "</script>"
set conn=nothing
conn.close
end if
%>
<%
end if
%>
(action.asp文件)
提示语句未结束(红色标记),我是直接访问这个页面的,照理说应该到guanli.asp,但老提示语句未结束。请您帮忙!

------解决方案--------------------
sql2="insert into hangye(hangye,other,guimo) values('"&hangye&"','"&other2&",'"&guimo&"')" '
改为

'"&other2"','"&guimo&"')" '

------解决方案--------------------
符号惹的祸,楼主应该是从新手到老手的转变过程中吧,觉得一些代码写的够多的,求速不求稳了,多注意符号,特别是写SQL语句DELETE的时候,我也做过一样的事,把公司2个月的营销数据全删了。