03 2012 档案

检查用户输入的一段代码
摘要://检查用户输入,不符合规则不允许提交查询---bywangguan2012-03-26functioncheckInput(){varinput=document.getElementById('userlist');if(!input){returnfalse;}varuserlist=input.value,p=/^(?:[\u4E00-\u9FA5\w]+(?:,[\u4E00-\u9FA5\w]+)*)?$/g,//必须是以英文逗号分割的用户名,默认为用户名为字母数字下划线或中文,首尾不能为任何特殊符号m='';if((m=p.exec(userlis 阅读全文

posted @ 2012-03-27 11:56 argb 阅读(223) 评论(0) 推荐(0)

php 随笔
摘要:html实体分为alpha entities(named entities)和numeric entities,php函数htmlspecialchars、htmlentities都只能转化为alpha entities,如果要转化为numeric entities要使用mb_encode_numericentity函数,如转化为GBK编码的numeric entities:$str="(王贯)'<";$convmap=array(0x0,0xffff,0,0xffff);$str=mb_encode_numericentity($str, $convmap, 阅读全文

posted @ 2012-03-22 12:55 argb 阅读(300) 评论(0) 推荐(0)

导航