%PDF- %PDF-
Direktori : /home/jalalj2hb/public_html/gae/application/controllers/ |
Current File : /home/jalalj2hb/public_html/gae/application/controllers/Welcome.php |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see https://codeigniter.com/user_guide/general/urls.html */ public function __construct() { session_start(); unset($_SESSION['user']); parent::__construct(); $this->load->database(); $this->load->helper('url'); $this->load->library('grocery_CRUD'); } public function index() { if(isset($_POST['submit'])){ $email=$_POST['email']; $password=$_POST['password']; $sql_="select * from user where email='$email' and password='$password' LIMIT 1"; $query = $this->db->query($sql_); $rows=$query->result_array(); if(count($rows)>0){ if(!isset($_SESSION)){session_start();} $_SESSION['user']=$rows[0]; header("location:".$this->config->base_url()."index.php/Main/Auto_Ecole"); } } $this->load->view('welcome_message'); } }