Skip to Content
PHPCODE
CodeIgniter Redirect After Login
codeigniter code / July 29, 2018

Redirect After login in codeignter

step 1 : created admin_header.php in view
for Example
<!DOCTYPE html>
<html>
<head>
<title>Article List</title>
<!– <link rel=”stylesheet” type=”text/css” href=”http://localhost/project_codeigniter/assets/css/bootstrap.min.css”> –>
<!– <link rel=”stylesheet” type=”text/css” href=”<?php // echo base_url’assets/css/bootstrap.min.css);?>”> –>
<?= link_tag(‘assets/css/bootstrap.min.css’);?>
</head>
<body>
<nav class=”navbar navbar-expand-lg navbar-dark bg-primary”>
  <a class=”navbar-brand” href=”#”>Articles</a>
  <button class=”navbar-toggler” type=”button” data-toggle=”collapse” data-target=”#navbarColor01″ aria-controls=”navbarColor01″ aria-expanded=”false” aria-label=”Toggle navigation”>
    <span class=”navbar-toggler-icon”></span>
  </button>

  <div class=”collapse navbar-collapse” id=”navbarColor01″>
    <ul class=”navbar-nav mr-auto”>
      <li class=”nav-item active”>
        <a class=”nav-link” href=”#”>Login<span class=”sr-only”>(current)</span></a>
      </li>
    </ul>
    <form class=”form-inline my-2 my-lg-0″>
      <input class=”form-control mr-sm-2″ type=”text” placeholder=”Search”>
      <button class=”btn btn-secondary my-2 my-sm-0″ type=”submit”>Search</button>
    </form>
  </div>
</nav>

step 2 :created admin_footer.php in view
<script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js”></script>
<script src=”<?= base_url(‘assets/js/bootstrap.min.js’);?>”></script>
</body>
</html>

step 3 :created dashboard.php in view
<?php include(‘admin_header.php’);?>

<?php include(‘admin_footer.php’);?>

PHPCODE © 2024