Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: trust2
  5. * Date: 19/09/19
  6. * Time: 09.37
  7. */
  8.  
  9. class User extends CI_Controller
  10. {
  11.  
  12. public function __construct()
  13. {
  14. parent::__construct();
  15. $this->load->model("user_model");
  16. }
  17.  
  18. public function view()
  19. {
  20. $this->load->view('user');
  21. }
  22.  
  23. public function index()
  24. {
  25. $username = $this->input->post('email');
  26. $test = $this->user_model->getUsername($username);
  27.  
  28. if(!empty($test))
  29. {
  30. $test = 1;
  31. }else{
  32. $test = 0;
  33. }
  34.  
  35. echo json_encode($test);
  36.  
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement