title: Fatal error: Uncaught Error: Call to undefined function redirect() PHP logout session
body: <p>I have problem when I logout in an admin panel with the logout page session. It shows the following error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Call to undefined function redirect() in
    C:\xampp\htdocs\CMS\admin\logout.php:7 Stack trace: #0 {main} thrown
    in C:\xampp\htdocs\CMS\admin\logout.php on line 7</p>
  </blockquote>
  
  <p>Instead, it should show the login page. My code:</p>
  
  <pre><code>&lt;?php include("includes/header.php");?&gt;
  
  &lt;?php
  $session-&gt;logout();
  redirect("login.php");
  ?&gt;
  </code></pre>