title: How to call functions from another file in php?
body: <p>I have php file "user.class.php" with lot of functions. There is part of this:</p>
  
  <pre><code>/**
  *Biztositja, hogy a jelszo visszafejthetetlen legyen
   */
      function encode_password($password){
          return md5("dF6u2#j@jd".$password."5YVM7&amp;fdsga");
      }
  
  /**
  *Ellenorzi, hogy letezo status kod lett-e megadva
   */
      function validate_status($status){      
          if($status == 1 || $status == 4) return $status;
          else die('Status Error');
      }
  
  
  /**
  *Bejelentkezes
   */
      function login($email,$password){
  
          $encoded_password = $this-&gt;encode_password($password);
          $res = $this-&gt;db-&gt;select("SELECT * FROM `users` WHERE email = '".$email."' AND password = '".$encoded_password."' AND status &lt; 8 LIMIT 1");
          $r = mysql_fetch_array($res);
          if($r['user_id'] &gt; 0)
          {
              $this-&gt;clear_session_variables("user_status");
              $_SESSION['username'] = $r['username'];
  
              return $r['user_id'];
              redirect("../../index.php&amp;msg=del_success");
          }else{
              return false;
          }
  
      }
  
  /**
  *Kijelentkezes
   */
      function logout(){
  
          $this-&gt;clear_session_variables();
  
      }
  
  
  /**
  *torli a megadott session valtozokat vagy az egesz sessiont
   */
      function clear_session_variables($variables=''){
  
          if($variables==''){
  
              // Unset all of the session variables.
              $_SESSION = array();
              // Finally, destroy the session.
              session_destroy();
  
          }else{
  
              $var = split(",",$variables);
              foreach($var as $v){
                  $_SESSION[$v] = '';
              }
  
          }
  
      }
  
  
  /**
  *Ellenorzi, hogy be van-e jelentkezve
   */
      function is_logged_in(){
  
          if (!isset($_SESSION['uid']) || $_SESSION['uid']&lt;=0){ return false;}
          else { return true; }
  
      }
  
  /**
  *Visszaadja a felhasznalo statuszat
   */
      function get_status($user_id){
  
          return $this-&gt;db-&gt;select_one("SELECT status FROM `users` WHERE user_id = '".$user_id."' LIMIT 1");
  
      }
  </code></pre>
  
  <p>I have included user.class.php in my index.php and some code for see if user is logged in:</p>
  
  <pre><code>&lt;?php
  
      print_r($_SESSION);
  
      if(isset($_SESSION['uid']) ){
  
      if ($_SESSION['uid']=='1'){
      include("./modules/frontend/user_menu.php");
  }   elseif ($_SESSION['uid']=='5'){
      include("./modules/frontend/admin_menu.php");
  }   else {
      include("./modules/frontend/login_form.php");
      }} ?&gt;
  </code></pre>
  
  <p>So, How can I call this functions on my index.php? I try all variations of function calling but i get always error mesage. The functions is working fine, the problem is i need to write forms for login, button for logout and other things, but i cant call functions for something. </p>
  
  <p>Call to undefined function logout() ??? why??</p>