国内流行的内容管理系统(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.

65 lines
1.8KB

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