问题描述
在做http://www.111cn.net/list-271/的过程中用到了微信抽奖,看了其他的作者都只是吧微信抽奖的页面共享出来了。作者现在把转盘抽奖程序和微信抽奖页面都共享出来,有需要的自己把两者组合一下即可。http://uni-key.com/c/data/atta ... 3.jpg **2014030702013262.jpg** _(35.14 KB, 下载次数: 0)_http://uni-key.com/c/forum.php ... 3Dyes 4 天前 上传 部份源码:配置文件 'mysql', 'DB_HOST' => '127.0.0.1', 'DB_NAME' => 'ites', 'DB_USER' => 'root', 'DB_PWD' => '111111', 'DB_PORT' => 3306, 'DB_PREFIX' => 'it_', 'APP_DEBUG' => 1, 'SHOW_ERROR_MSG' => 1, 'SHOW_PAGE_TRACE' => 1, 'DATA_CACHE_TYPE' => 'Redis', 'REDIS_HOST' => '127.0.0.1', 'REDIS_PORT' => 6379, 'DATA_CACHE_TIME' => 3600, 'URL_CASE_INSENSITIVE' => true, 'TMPL_STRIP_SPACE' => false, 'URL_HTML_SUFFIX' => '', 'SITE_NAME' => '11111', 'SITE_URL' => 'http://www.111cn.net/', 'WECHAT_TOKEN' => '你的', 'WECHAT_APPID' => '你的', 'WECHAT_APPSECRET' => '你的', 'DATA_AUTH_KEY' => 'abcdddd',);?>_复制代码_commond.php文件 6 && preg_match("/^+@+(.w+)+$/", $email);}/** * 发送HTTP请求方法,目前只支持CURL发送请求* @param string $url 请求URL * @param array $params 请求参数* @param string $method 请求方法GET/POST * @return array $data 响应数据*/function http($url, $params, $method = 'GET', $header = array(), $multi = false){ $opts = array( CURLOPT_TIMEOUT => 30, CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HTTPHEADER => $header ); /* 根据请求类型设置特定参数 */switch(strtoupper($method)){ case 'GET': $opts = $url . '?' . http_build_query($params); break; case 'POST': //判断是否传输文件 //$params = $multi ? $params : http_build_query($params); $opts = $url; $opts = 1; $opts = $params; break; default: throw new Exception('不支持的请求方式!'); } /* 初始化并执行curl请求 */ $ch = curl_init(); curl_setopt_array($ch, $opts); $data = curl_exec($ch); $error = curl_error($ch); curl_close($ch); if($error) throw new Exception('请求发生错误:' . $error); return $data;}/** * 不转义中文字符和/的 json 编码方法* @param array $arr 待编码数组* @return string */function jsencode($arr) { $str = str_replace ( "/", "/", json_encode ( $arr ) ); $search = "#u(+)#ie"; if (strpos ( strtoupper(PHP_OS), 'WIN' ) === false) { $replace = "iconv('UCS-2BE', 'UTF-8', pack('H4', '1'))";//LINUX } else { $replace = "iconv('UCS-2', 'UTF-8', pack('H4', '1'))";//WINDOWS } return preg_replace ( $search, $replace, $str );}// 数据保存到文件function data2file($filename, $arr=''){ if(is_array($arr)){ $con = var_export($arr,true); $con = ""; } else{ $con = $arr; $con = ""; } write_file($filename, $con);}/** * 系统加密方法* @param string $data 要加密的字符串* @param string $key 加密密钥* @param int $expire 过期时间 单位 秒* @return string * @author winky */function encrypt($data, $key = '', $expire = 0) { $key = md5(empty($key) ? C('DATA_AUTH_KEY') : $key); $data = base64_encode($data); $x = 0; $len = strlen($data); $l = strlen($key); $char = ''; for ($i = 0; $i 0 && $expire where ('status = 3')->order ( 'sort,itemid' )->getField('itemid,title,pid,arrparentid,child'); //把市的省拚出来 foreach ($area as $k=>$v){ //如果是顶级 if ($v==0){ $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; //上级 $areaArr[$v] = $v; $areaArr[$v] = $v; } //查出上级的名称和ID else { $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; $areaArr[$v] = $v; //上级 $areaArr[$v] = $area[$v]; $areaArr[$v] = $area[$v]; } } $area = $areaArr; S ( 'S_Area' , $area ); } return $area;}?>_复制代码_附件由于附件过大,请在作者发布链接下载 转自:http://www.111cn.net/phper/php-cy/58547.htm