my_channal_put.php 867 B

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