| 12345678910111213141516171819 |
- <?php
- require_once "../path.php";
- require_once "../public/_pdo.php";
- require_once '../public/function.php';
- require_once '../hostsetting/function.php';
- $respond=array("status"=>0,"message"=>"");
- PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
- $query="INSERT INTO article ( id, title , subtitle , summary , content , tag , owner, setting , status , create_time , modify_time , receive_time ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";
- $sth = $PDO->prepare($query);
- $sth->execute(array(UUID::v4() , $_POST["title"] , "" ,"", "" , "" , $_COOKIE["userid"] , "{}" , 1 , mTime() , mTime() , mTime() ));
- $respond=array("status"=>0,"message"=>"");
- if (!$sth || ($sth && $sth->errorCode() != 0)) {
- $error = PDO_ErrorInfo();
- $respond['status']=1;
- $respond['message']=$error[2];
- }
- echo json_encode($respond, JSON_UNESCAPED_UNICODE);
- ?>
|