title: how to fix fatal error - Class 'User' not found in php
body: <p>This is user class.</p>
  
  <pre><code>&lt;?php
  class User {
      /* 
       *public static function get_all_users()
       */
      public function get_all_users() {
          global $link;
          $result_set = $link-&gt;query("SELECT * FROM `user`");
          return $result_set;
      }
  }
  </code></pre>
  
  <p>Above class is user class i made object but cannot access. Display all use page of html:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=Cp1252"&gt;
  &lt;title&gt;Admin Panel ::: &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Users :&lt;/h3&gt;
      &lt;table border="1"&gt;
          &lt;tr&gt;
              &lt;th&gt;S.N&lt;/th&gt;
              &lt;th&gt;First Name&lt;/th&gt;
              &lt;th&gt;Last Name&lt;/th&gt;
              &lt;th&gt;Username&lt;/th&gt;
              &lt;th&gt;Password&lt;/th&gt;
              &lt;th&gt;E-mail&lt;/th&gt;
              &lt;th&gt;Contact&lt;/th&gt;
              &lt;th colspan="2"&gt;Option&lt;/th&gt;
          &lt;/tr&gt;
          &lt;?php 
              $user = new User();
              $result_set = $user-&gt;get_all_users();
              /* 
               *$result_set = User :: get_all_users(); - accessing user class using static keyword.
               */
              $i = 1;
              while ($row = mysqli_fetch_assoc($result_set)) {
          ?&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo $row['id']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['first_name']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['last_name']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['username']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['password']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['email']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo $row['Contact']; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=""&gt;Update&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=""&gt;Delete&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;                                           
          &lt;?php 
                  $i++;
              }
          ?&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I can not access user class when I create object of user class and user class is inside includes folder and below HTML file is inside admin folder or <code>admin -&gt;viewuser.php</code> and <code>admin-&gt;includes-&gt;user.php</code> it gives error.</p>