加上这个简单的函数,判断怎么都不成立了?
判断字符串是否合法函数:
function checkstr(str)
if Instr(str,"=")>0 or Instr(str,"%")>0 or Instr(str,chr(32))>0 or Instr(str,"?")>0 or Instr(str,"&")>0 or Instr(str,";")>0 or Instr(str,",")>0 or Instr(str,"'")>0 or Instr(str,",")>0 or Instr(str,chr(34))>0 or Instr(str,chr(9))>0 or Instr(str,"")>0 or Instr(str,"$")>0 then
checkstr=false
end if
end function
调用过程
if checkstr(v_realname)=false then
founderr=true
errmsg=errmsg&"<br><li>您的姓名中含有非法字符!请重新输入!</li>"
end if
可测试时,不管符合不符合都有不成立,显示“重新输入”信息!
大家帮我看看,是调用不对还是函数有错?