my_article_put.php 896 B

123456789101112131415161718192021
  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 article ( id, title , subtitle , summary , content , tag , owner, setting , status , create_time , modify_time , receive_time ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";
  10. $sth = $PDO->prepare($query);
  11. $sth->execute(array(UUID::v4() , $_POST["title"] , "" ,"", "" , "" , $_COOKIE["userid"] , "{}" , 1 , mTime() , mTime() , mTime() ));
  12. $respond=array("status"=>0,"message"=>"");
  13. if (!$sth || ($sth && $sth->errorCode() != 0)) {
  14. $error = PDO_ErrorInfo();
  15. $respond['status']=1;
  16. $respond['message']=$error[2];
  17. }
  18. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  19. ?>