title: Call to undefined function error even function is defined
body: <p>I have a file which is session secured "admin.php". This is default page after login.
  This throwing an error given below:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined function listPages() in C:\xampp\htdocs\cd-website\cms\admin.php on line 14</p>
  </blockquote>
  
  <pre><code>&lt;?php
  /*
  * initialize session for admin
  */
  session_start();
  
  if(isset($_SESSION['admin_user']))
  {
      require_once '../cms/config.php';
  
      $action = isset($_POST['action']) ? $_POST['action'] : '';
  
      if ($action == null)
      {
          listPages();
          exit;
      }
  
      /*
       * using switch for choosing function
       */
      switch($action)
      {
          case 'ManagePages':
              ManagePages();
              break;
          case 'listUsers':
              listUsers();
              break;
          case 'orderList':
              listOrders();
              break;
          case 'listBanner':
              listBanners();
              break;
          case 'NewsletterUser':
              NewsletterUsers();
              break;
          case 'Newsletter':
              Newsletter();
              break;
          case 'listQuestion':
              listquestions();
              break;
          case 'testinomial':
              listTesti();
              break;
          default:
              listPages();
      }
  
      /*
       * different function for different tasks
       */
      function ManagePages()
      {
          listPages();
      }
  
      function listUsers()
      {
          // include listusers.php here. required rows is in listusers.php file
      }
  
      function listOrders()
      {
          // include listorders.php here
      }
  
      function  listBanners()
      {
          // include listbanners.php here
      }
  
      function  NewsletterUsers()
      {
          // include listNUsers.php here
      }
  
      function listquestions()
      {
          // include listquestions.php here.
      }
  
      function listTesti()
      {
          // include listTesti.php here.
      }
  
      function Newsletter()
      {
          //  include newsletter.php
      }
  
      function listPages()
      {
          //  include listPages.php here
      }
  }
  else
  {
      header("Location:index.php");
  }
  </code></pre>
  
  <p>When i try to solve error on line 14, it shows error on every line where <code>listPages()</code> exist.</p>
  
  <p>Why it so? Please help!</p>