gundambison

save.php

Jun 14th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. $result = array(
  4.     'status' => FALSE,
  5.     'message' => NULL
  6. );
  7. /*
  8.  * To change this license header, choose License Headers in Project Properties.
  9.  * To change this template file, choose Tools | Templates
  10.  * and open the template in the editor.
  11.  */
  12.  
  13. $result['post'] = $post = $_POST;
  14.  
  15. if (isset($post['status']) && $post['status'] == 1) {
  16.     $result['status'] = TRUE;
  17. } elseif (isset($post['status']) && $post['status'] == 0) {
  18.     $result['message'] = 'silakan ganti dengan pilihan lain';
  19. } else {
  20.     $result[''] = 'unk';
  21. }
  22.  
  23. unset($result['post']);
  24.  
  25. echo json_encode($result);
Advertisement
Add Comment
Please, Sign In to add comment