人人商城

wxcode.ctrl.php 1006B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. $dos = array('verifycode', 'image');
  8. $do = in_array($do, $dos) ? $do : 'verifycode';
  9. $_W['uniacid'] = intval($_GPC['uniacid']);
  10. if($do == 'verifycode') {
  11. load()->func('communication');
  12. $username = trim($_GPC['username']);
  13. $response = ihttp_get("https://mp.weixin.qq.com/cgi-bin/verifycode?username={$username}&r=" . TIMESTAMP);
  14. if(!is_error($response)) {
  15. isetcookie('code_cookie', $response['headers']['Set-Cookie']);
  16. header('Content-type: image/jpg');
  17. echo $response['content'];
  18. exit();
  19. }
  20. } elseif($do == 'image') {
  21. load()->func('communication');
  22. $image = trim($_GPC['attach']);
  23. if(empty($image)) {
  24. exit();
  25. }
  26. $content = ihttp_request($image, '', array('CURLOPT_REFERER' => 'http://www.qq.com'));
  27. header('Content-Type:image/jpg');
  28. echo $content['content'];
  29. exit();
  30. }