登陆
浏览模式: 标准 | 列表 Tag: 验证

验证sql保留字 HTML

来自Readlog.cn大鸟哥给的小玩意儿 在写delphi进行sql数据操作的时候进这里html文件里头耍耍

DEMO地址http://www.readlog.cn/demo/html/sql.htm

XML/HTML代码
  1. <html>     
  2. <head><title>验证sql保留字</title>  
  3. <script type="text/javascript">  
  4. function isSql(objID)     
  5. {   
  6. var i,msg;   
  7. var str=document.getElementById(objID).value.toLowerCase();   
  8. var w=",action,add,aggregate,all,alter,after,and,as,asc,avg,avg_row_length,auto_increment,between,bigint,bit,binary,blob,bool,both,by,cascade,case,char,character,change,check,checksum,column,columns,comment,constraint,create,cross,current_date,current_time,current_timestamp,data,database,databases,date,datetime,day,day_hour,day_minute,day_second,dayofmonth,dayofweek,dayofyear,dec,decimal,default,delayed,delay_key_write,delete,desc,describe,distinct,distinctrow,double,drop,end,else,escape,escaped,enclosed,enum,explain,exists,fields,file,first,float,float4,float8,flush,foreign,from,for,full,function,global,grant,grants,group,having,heap,high_priority,hour,hour_minute,hour_second,hosts,identified,ignore,in,index,infile,inner,insert,insert_id,int,integer,interval,int1,int2,int3,int4,int8,into,if,is,isam,join,key,keys,kill,last_insert_id,leading,left,length,like,lines,limit,load,local,lock,logs,long,longblob,longtext,low_priority,max,max_rows,match,mediumblob,mediumtext,mediumint,middleint,min_rows,minute,minute_second,modify,month,monthname,myisam,natural,numeric,no,not,null,on,optimize,option,optionally,or,order,outer,outfile,pack_keys,partial,password,precision,primary,procedure,process,processlist,privileges,read,real,references,reload,regexp,rename,replace,restrict,returns,revoke,rlike,row,rows,second,select,set,show,shutdown,smallint,soname,sql_big_tables,sql_big_selects,sql_low_priority_updates,sql_log_off,sql_log_update,sql_select_limit,sql_small_result,sql_big_result,sql_warnings,straight_join,starting,status,string,table,tables,temporary,terminated,text,then,time,timestamp,tinyblob,tinytext,tinyint,trailing,to,type,use,using,unique,unlock,unsigned,update,usage,values,varchar,variables,varying,varbinary,with,write,when,where,year,year_month,zerofill,";   
  9. msg=w.indexOf(","+str+",")!=-1?"":"不";   
  10. alert(str+msg);   
  11. }   
  12. </script>     
  13. </head>     
  14. <body>     
  15. <h3>sql保留字验证</h3><hr>     
  16. 请输入保留字:     
  17. <input id="wd" type="text" size=8>     
  18. <input type="button" value="提交" onclick="isSql('wd');">     
  19. </body>     
  20. </html>  

Tags: 验证, sql, 保留字, html

大鸟哥给的一段检测是否数字代码 简单

 刚在写asp呵呵碰到检测数字的了 以前用了javascript现在用起来不会了 太久没玩asp了

(*^__^*) 嘻嘻……刚好大鸟哥给我丢了一段Function来IsInt返回Boolean 是数字就是True啦

ASP/Visual Basic代码
  1. Function IsInt(Str)   
  2. Dim Re   
  3. Set Re = New RegExp   
  4.     Re.Global = True  
  5.     Re.IgnoreCase = False  
  6.     Re.MultiLine = False  
  7.     Re.Pattern = "^[1-9]{1}[0-9]*$"  
  8.     IsInt=Re.Test(Str)   
  9. Set Re=Nothing  
  10. End Function  

Tags: 简单, 数字, 验证, 检查, 是否数字