my_channal_put.php 855 B

1234567891011121314151617181920
  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. $respond=array("status"=>0,"message"=>"");
  7. if(isset($_COOKIE["userid"])){
  8. PDO_Connect(""._FILE_DB_CHANNAL_);
  9. $query="INSERT INTO channal ( id, owner , name , summary , status , lang, create_time , modify_time , receive_time ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";
  10. $sth = $PDO->prepare($query);
  11. $sth->execute(array(UUID::v4() , $_COOKIE["userid"] , $_POST["name"] , "" , $_POST["status"] ,$_POST["lang"] , 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. }
  19. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  20. ?>