为什么我在提交表单的时候只能提交数字不能提交文字?

madnesser 2009-08-17 04:39:14
为什么我在提交数据的时候 只能提交数字不能提交文字呢? 数据库里面已经设置成文本了


里面的 “tongxin”字段 无法提交文字啊 只能提交数字!!


<%
Sub LockAdd
%>
<form method=post action='m1l1ip.Asp?operate=save'>
<tr>
<td align=right colspan=3>IP地址:</td>
<td Colspan=3>
<input name=ip1 style="width:75" maxlength="3"> . 
<input name=ip2 style="width:75" maxlength="3"> . 
<input name=ip3 style="width:75" maxlength="3"> . 
<input name=ip4 style="width:75" maxlength="3"></td></tr>

<tr>
<td align=right colspan=3>IP段数:</td>
<td Colspan=3>
<select name=ipsame>
<%
For i=1 to 4
Response.write"<option value="&i&" "
If i=4 Then Response.write" Selected "
Response.write">前 "&i&" 段相同</option>"
Next
%>
</select></td>
</tr>
<tr>
<td align=right colspan=3>所属网络:</td>
<td Colspan=3><textarea name="tongxin" rows="2" style="width:330"></textarea></td>
</tr>
<tr>
<td align=right colspan=3>原因说明:</td>
<td Colspan=3>
<textarea name="reason" rows="6" style="width:330"></textarea></td>
</tr>
<tr>
<td Colspan=6 align=center><input name="shixiao" type="hidden" value=1><input type=submit value="对上面的IP地址封锁"> <INPUT type=reset value=" 擦除重填 "></td>
</tr>
</form>

<%
End Sub

Sub SaveLock
DIm IPArr(3)
For i=0 to 3
IPArr(i)=Trim(request.form("ip"&i+1&""))
If IpArr(i)="" Or IsNumeric(IpArr(i))=False Then
response.write ("<div align=center><BR><BR><font size=5 color=#Cc0000><b>错误提示:第"&i+1&"段必须数字</b></font></div>")
response.write ("<BR><BR>"&GetBack2)
Exit Sub
End If
Next
Conn.Execute("insert into IpLock (ip1,ip2,ip3,ip4,tongxin,ipsame,iplock,shixiao) values ("&Cint(IPArr(0))&","&Cint(IPArr(1))&","&Cint(IPArr(2))&","&Cint(IPArr(3))&","&Cint(Request.Form("ipsame"))&","&Request("tongxin")&",'"&Request.form("reason")&"|"&Now&"',"&Request("shixiao")&")")
BoolBase(0)=1
Conn.ExeCute("Update IpLockFlag set Boolbase='"&Join(BoolBase,"|")&"'")
response.write ("<div align=center><BR><BR><font size=5 color=#Cc0000><b>操作提示:IP-"&RealLock(Cint(Request.Form("ipsame")),iparr(0),iparr(1),iparr(2),iparr(3))&" 已被锁定!</b></font></div>")
response.write ("<BR><BR><BR>"&GetBack2)
End Sub

Function RealLock(IPsame,Ip1,ip2,ip3,ip4)
IF IPsame=1 Then
RealLock="<b>"&IP1&".*.*.*</b>"
ElseIF IPsame=2 Then
RealLock="<b>"&IP1&"."&IP2&".*.*</b>"
ElseIF IPsame=3 Then
RealLock="<b>"&IP1&"."&IP2&"."&IP3&".*</b>"
ElseIF IPsame=4 Then
RealLock="<b>"&IP1&"."&IP2&"."&IP3&"."&IP4&"</b>"
End IF
End Function
%>
...全文
147 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Atai-Lu 2009-08-17
  • 打赏
  • 举报
回复
Sub SaveLock
DIm IPArr(3)
For i=0 to 3
IPArr(i)=Trim(request.form("ip"&i+1&""))
If IpArr(i)="" Or IsNumeric(IpArr(i))=False Then
response.write (" <div align=center> <BR> <BR> <font size=5 color=#Cc0000> <b>错误提示:第"&i+1&"段必须数字 </b> </font> </div>")
response.write (" <BR> <BR>"&GetBack2)
Exit Sub
hookee 2009-08-17
  • 打赏
  • 举报
回复
Request("tongxin")两边少单引号

Conn.Execute("insert into IpLock (ip1,ip2,ip3,ip4,tongxin,ipsame,iplock,shixiao) values ("&Cint(IPArr(0))&","&Cint(IPArr(1))&","&Cint(IPArr(2))&","&Cint(IPArr(3))&","&Cint(Request.Form("ipsame"))&",'"&Request("tongxin")&"','"&Request.form("reason")&"|"&Now&"',"&Request("shixiao")&")")

thinsoft 2009-08-17
  • 打赏
  • 举报
回复
少了'号吧

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧