my_collect_put.php 939 B

1234567891011121314151617181920212223
  1. <?php
  2. require_once "../path.php";
  3. require_once "../public/_pdo.php";
  4. require_once '../public/function.php';
  5. require_once '../hostsetting/function.php';
  6. require_once "../ucenter/active.php";
  7. $respond=array("status"=>0,"message"=>"");
  8. PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
  9. $query="INSERT INTO collect ( id, title , subtitle , summary , article_list , owner, lang , status , create_time , modify_time , receive_time ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";
  10. $sth = $PDO->prepare($query);
  11. $uuid = UUID::v4();
  12. add_edit_event(_COLLECTION_NEW_,$uuid);
  13. $sth->execute(array($uuid , $_POST["title"] , "" ,"", "[]" , $_COOKIE["userid"] , "" , 1 , mTime() , mTime() , mTime() ));
  14. $respond=array("status"=>0,"message"=>"");
  15. if (!$sth || ($sth && $sth->errorCode() != 0)) {
  16. $error = PDO_ErrorInfo();
  17. $respond['status']=1;
  18. $respond['message']=$error[2];
  19. }
  20. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  21. ?>