国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8KB

  1. <?php
  2. /**
  3. * 错误提交
  4. *
  5. * @version $Id: erraddsave.php$
  6. * @package DedeBIZ.Site
  7. * @copyright Copyright (c) 2022, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/../system/common.inc.php");
  12. require_once(DEDEINC.'/memberlogin.class.php');
  13. $dopost = isset($dopost) ? $dopost : "";
  14. $aid = isset($aid) ? intval($aid) : 0;
  15. if (empty($aid)) {
  16. echo json_encode(array(
  17. "code" => -1,
  18. "data" => null,
  19. "msg" => "请求错误",
  20. ));
  21. exit;
  22. }
  23. if ($dopost == "saveedit") {
  24. $cfg_ml = new MemberLogin();
  25. $title = HtmlReplace($title);
  26. $format = isset($format) ? $format : "";
  27. $type = isset($type) && is_numeric($type) ? $type : 0;
  28. $mid = isset($cfg_ml->M_ID) ? $cfg_ml->M_ID : 0;
  29. $err = trimMsg(cn_substr(RemoveXSS($err), 2000), 1);
  30. $oktxt = trimMsg(cn_substr(RemoveXSS($erradd), 2000), 1);
  31. if (empty($err) || empty($oktxt)) {
  32. echo json_encode(array(
  33. "code" => -1,
  34. "data" => null,
  35. "msg" => "错误内容或建议不能为空",
  36. ));
  37. exit;
  38. }
  39. $time = time();
  40. $query = "INSERT INTO `#@__erradd`(aid,mid,title,type,errtxt,oktxt,sendtime)
  41. VALUES ('$aid','$mid','$title','$type','$err','$oktxt','$time'); ";
  42. $dsql->ExecuteNoneQuery($query);
  43. if (!empty($format)) {
  44. echo json_encode(array(
  45. "code" => 200,
  46. "data" => "ok",
  47. ));
  48. } else {
  49. ShowMsg("谢谢您对本网站的支持,我们会尽快处理您的建议", "javascript:window.close();");
  50. }
  51. exit();
  52. } else {
  53. echo json_encode(array(
  54. "code" => -1,
  55. "data" => null,
  56. "msg" => "未知方法",
  57. ));
  58. exit;
  59. }