摘要: public static function generate_word($length) { // 密码字符集,可任意添加你需要的字符 $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-'; $password = ''; for ($i = 0; $i < $length; $i++) { // 这里提供两种字符获取方式 // 第一种是使用 substr 截取$chars中的任意一位字符; ... 阅读全文
posted @ 2012-06-26 13:49 firesnow 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 基本思路是在URL随机字符串后缀上当前时间 点击邮件处理的时候再取一次当前时间 两个时间作比较$password = XUtil::generate_word($length); //生成随机数$now_time = strtotime(date("Y-m-d H:i:s")); //取当前时间并转化为时间戳$password = $password.$now_time; //合在一起 $oldtime = substr($key,30,10); //分割字符串取出时间戳$nowtime = strtotime(date(... 阅读全文
posted @ 2012-06-26 13:48 firesnow 阅读(618) 评论(0) 推荐(1) 编辑