put_state.php 978 B

12345678910111213141516171819202122232425
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. require "../system/db.class.php";
  4. error_reporting(0);
  5. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  6. header("Cache-Control: no-cache, must-revalidate");
  7. header("Pragma: no-cache");
  8. header("Content-type: text/html;charset=" . IN_CHARSET);
  9. header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);
  10. header("Access-Control-Allow-Credentials: true");
  11. $id = intval(SafeRequest("id", "get"));
  12. $step = SafeRequest("step", "get");
  13. $percent = intval(SafeRequest("percent", "get"));
  14. $pw = SafeRequest("pw", "get");
  15. $pw && $pw == IN_SECRET || exit("Access denied");
  16. $row = db("appid")->where("in_id", $id)->find();
  17. if (!$row) {
  18. exit;
  19. }
  20. if (!db("signlog")->where(array("in_aid" => $id))->count()) {
  21. db("signlog")->insert(array("in_aid" => $id, "in_step" => $step, "in_percent" => $percent));
  22. } else {
  23. db("signlog")->where(array("in_aid" => $id))->update(array("in_step" => $step, "in_percent" => $percent));
  24. }