inc_certify.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. if (!defined('IN_MYMPS')) {
  3. exit('Forbidden');
  4. }
  5. $ac = !in_array($ac, array('person', 'com', 'sjrz')) ? 'person' : trim($ac);
  6. if (submit_check('certify_submit')) {
  7. require_once MYMPS_INC . '/upfile.fun.php';
  8. $name_file = 'certify_image';
  9. if ($ac == 'person') {
  10. $typeid = 2;
  11. }
  12. else if ($ac == 'com') {
  13. $typeid = 1;
  14. }
  15. else if ($ac == 'sjrz') {
  16. $typeid = 3;
  17. if (!$mobile) {
  18. write_msg('请输入您的手机号码!');
  19. }
  20. if (!is_mobile($mobile)) {
  21. write_msg('手机号格式不正确!');
  22. }
  23. $smscheckcode = $smscheckcode ? mhtmlspecialchars($smscheckcode) : '';
  24. if (!mymps_chk_smsrandcode($smscheckcode, $mobile)) {
  25. write_msg('手机验证码输入不正确或与手机号不匹配!');
  26. }
  27. $db->query('UPDATE `' . $db_mymps . 'member` SET sj_certify = \'1\',mobile=\'' . $mobile . '\' WHERE userid = \'' . $s_uid . '\'');
  28. write_msg('', '?m=certify&ac=sjrz&success=8');
  29. exit();
  30. }
  31. if ($_FILES[$name_file]['name']) {
  32. check_upimage($name_file);
  33. $destination = '/certification/' . date('Ym') . '/';
  34. $mymps_image = start_upload($name_file, $destination, 0);
  35. $db->query('INSERT INTO `' . $db_mymps . 'certification` SET typeid=\'' . $typeid . '\',userid=\'' . $s_uid . '\',img_path=\'' . $mymps_image . '\',pubtime = \'' . $timestamp . '\'');
  36. }
  37. else {
  38. write_msg('', '?m=certify&error=13');
  39. }
  40. write_msg('', '?m=certify&success=9');
  41. }
  42. else {
  43. if ($pubtime = $db->getOne('SELECT pubtime FROM `' . $db_mymps . 'certification` ' . $where . ' ORDER BY pubtime DESC')) {
  44. $certifylang = '您已经于' . GetTime($pubtime) . '提交过认证图片,确认要重新提交吗?';
  45. }
  46. $location = location();
  47. include mymps_tpl('certify');
  48. }
  49. ?>