摘要: //2011-11-28 星期一 //程序员思想: <? session_start(); $admin = $_POST['admin']; $pass = md5($_POST['pass']); $codes = $_POST['codes']; if($_GET['action'])...{ if($result=$db->Execute("select * from x_admin where a_admin='".$admin."'"))...{ if 阅读全文
posted @ 2011-11-28 16:02 noevil 阅读(180) 评论(0) 推荐(0) 编辑
摘要: //2011-11-26 星期六 //正则实战: 字符串匹配: function isUsername($element) { return !preg_match ("/[a-zA-Z0-9_\-]/", $element); } ?> 密码匹配: $password = "Fyfjk34sdfjfsjq7"; if (preg_match("/^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/", $password)) { echo "Your passwords is 阅读全文
posted @ 2011-11-28 16:00 noevil 阅读(107) 评论(0) 推荐(0) 编辑
摘要: //2011-11-27 星期日 //正则实战(2): Preg_match验证URL $subscr=$_REQUEST['subscr']; //url validation if (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $subscr)) { print "$subscr url OK."; } else { print "$subscr url not valid!"; } //echo("$subsc 阅读全文
posted @ 2011-11-28 16:00 noevil 阅读(296) 评论(0) 推荐(0) 编辑
摘要: //2011-11-24 星期四 //程序员的思想 <% '略 attachdir="/"+sitePath+"upload"'上传文件保存路径,结尾不要带/ dirtype=2'1:按天存入目录 2:按月存入目录 3:按扩展名存目录 建议使用按天存 maxattachsize=2097152'最大上传大小,默认是2M upext="txt,rar,zip,jpg,jpeg,gif,png,swf,wmv,avi,wma,mp3,mid"'上传扩展名 '略 if upfile.is 阅读全文
posted @ 2011-11-28 15:57 noevil 阅读(151) 评论(0) 推荐(0) 编辑