Guest User

Untitled

a guest
Oct 6th, 2018
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2.     include("lib/ZerController.php");
  3.     //include("lib/ZerDB.php");
  4.  
  5.     class MainController extends ZerController{
  6.  
  7.         private $user;
  8.  
  9.         public function MainController(){
  10.  
  11.             $this->init();
  12.         }
  13.  
  14.         public function page(){
  15.             $vars = Array();
  16.             $vars['valor'] = $this->getView("prueba");
  17.             $this->printView("page", $vars);
  18.         }
  19.  
  20.         public function home(){
  21.             session_start();
  22.             $this->printView("home", $_SESSION["home_vars"]);
  23.         }
  24.  
  25.         public function index(){
  26.             $this->goToPage("login2");
  27.         }
  28.  
  29.         public function login2(){
  30.             $this->printView("login");
  31.             $user = $this->getReqParam("user");
  32.             $pass = $this->getReqParam("pass");
  33.  
  34.             if($user == "user" && $pass == "pass"){
  35.                 session_start();
  36.  
  37.  
  38.                 $_SESSION["home_vars"] = array(
  39.                     "colegio"=>"Nombre Del Colegio",
  40.                     "usuario"=>"usuario"
  41.                 );
  42.  
  43.                 $this->redirect("home");
  44.             }
  45.         }
  46.     }
  47. ?>
Add Comment
Please, Sign In to add comment