Advertisement
Guest User

Untitled

a guest
Sep 30th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. defined('BASEPATH') OR exit('No direct script access allowed');
  4.  
  5.  
  6. class LoginTwo extends CI_Controller
  7. {
  8.  
  9. function __construct() {
  10. parent::__construct();
  11. $this->load->model("login_model", "login");
  12.  
  13. }
  14. public function login()
  15. {
  16. $username = $this->input->post("username");
  17. $password = $this->input->post("password");
  18.  
  19. $isCorrect = $this->login->validate_user($username, $password);
  20.  
  21. if($isCorrect)
  22. {
  23. // Start your user session
  24.  
  25. $dirName = $username;
  26. $dirPath = "folder/".$dirName."/";
  27.  
  28. if (!file_exists($dirPath)) {
  29. mkdir("folder/" . $dirName, 0777, true);
  30. }
  31.  
  32. redirect("your user page");
  33. }
  34. else
  35. {
  36. redirect("homepage");
  37. }
  38. }
  39. }?>
  40.  
  41. $path = FCPATH.'/uploads/';
  42. $new_directory = 'name';
  43. mkdir($path.$name,0755,TRUE);
  44.  
  45. public function login()
  46. {
  47. $username = $this->input->post("username");
  48. $password = $this->input->post("password");
  49.  
  50. $isCorrect = $this->user_model->checkCredentials($username, $password);
  51.  
  52. if($isCorrect)
  53. {
  54. // Start your user session
  55.  
  56. $dirName = $username;
  57. $dirPath = "folder/".$dirName."/";
  58.  
  59. if (!file_exists($dirPath)) {
  60. mkdir("folder/" . $dirName, 0777, true);
  61. }
  62.  
  63. redirect("your user page");
  64. }
  65. else
  66. {
  67. redirect("homepage");
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement