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

  1. <?php
  2. /**
  3. *
  4. * 错误提交
  5. *
  6. * @version $Id: erraddsave.php 1 15:38 2010年7月8日Z tianya $
  7. * @package DedeCMS.Site
  8. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  9. * @license http://help.dedecms.com/usersguide/license.html
  10. * @link http://www.dedecms.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. {
  26. $cfg_ml = new MemberLogin();
  27. $title = HtmlReplace($title);
  28. $format = isset($format)? $format : "";
  29. $type = isset($type) && is_numeric($type) ? $type : 0;
  30. $mid = isset($cfg_ml->M_ID) ? $cfg_ml->M_ID : 0;
  31. $err = trimMsg(cn_substr(RemoveXSS($err),2000),1);
  32. $oktxt = trimMsg(cn_substr(RemoveXSS($erradd),2000),1);
  33. if (empty($err) || empty($oktxt)) {
  34. echo json_encode(array(
  35. "code" => -1,
  36. "data" => null,
  37. "msg" => "错误内容或建议不能为空",
  38. ));
  39. exit;
  40. }
  41. $time = time();
  42. $query = "INSERT INTO `#@__erradd`(aid,mid,title,type,errtxt,oktxt,sendtime)
  43. VALUES ('$aid','$mid','$title','$type','$err','$oktxt','$time'); ";
  44. $dsql->ExecuteNoneQuery($query);
  45. if (!empty($format)) {
  46. echo json_encode(array(
  47. "code" => 200,
  48. "data" => "ok",
  49. ));
  50. } else {
  51. ShowMsg("谢谢您对本网站的支持,我们会尽快处理您的建议!","javascript:window.close();");
  52. }
  53. exit();
  54. } else {
  55. echo json_encode(array(
  56. "code" => -1,
  57. "data" => null,
  58. "msg" => "未知方法",
  59. ));
  60. exit;
  61. }