ASP表单提交问题

来源:百度知道 编辑:UC知道 时间:2024/05/05 12:34:53
我写了一个表单提交 但是提交的时候提示类型不匹配 不知道为什么
我的代码如下
<!--#include file="conn.asp"-->
<%
name=Request.Form("name")
yh=Request.Form("yh")
haoma=Request.Form("haoma")
sm=Request.Form("sm")
jssj=Request.Form("jssj")
ip=Request.Form("ip")
qian=Request.Form("ip")*0.005
shijian=Request.Form("shijian")

if ip="" then

response.write"<script language=JavaScript>{window.alert('对不起,当日IP不能为空,请返回重新填写');window.location.href='yitong-jiesuan.asp';}</script>"
response.End()
end if

sql="insert into jiesuan(name,yh,haoma,sm,jssj,ip,qian) values('"+name+"','"+yh+"','"+haoma+"','"+sm+"','"+jssj+"','"+ip+"','"+qian+"')"
set savejiesuan=conn.ex

错在:
sql="insert into jiesuan(name,yh,haoma,sm,jssj,ip,qian) values('"+name+"','"+yh+"','"+haoma+"','"+sm+"','"+jssj+"','"+ip+"','"+qian+"')"
既然IP和qian是数据型的,那么
sql="insert into jiesuan(name,yh,haoma,sm,jssj,ip,qian) values('"+name+"','"+yh+"','"+haoma+"','"+sm+"','"+jssj+"',"+ip+","+qian+")"
数字型的不要在值上打双引号
更何况,你用的好像是VBSCRIPT脚本,不应该用"+"来连接字符
正确的应该是:
sql="insert into jiesuan(name,yh,haoma,sm,jssj,ip,qian) values('"&name&"','"&yh&"','"&haoma&"','"&sm&"','"&jssj&"',"&ip&","&qian&")"

老弟IP是四个数,,而192.168.1.1*0.005
你能看懂是什么意思吗?
先把ip转数字ip=cint(Request.Form("ip&q