title: PHP error Use of undefined constant includes - assumed 'includes'
body: <p>I am trying to roll my own project but I am having some trouble with a an error that I find a bit quirky and my IDE and xDebug are not turning up many options to a novice like myself.</p>
  
  <p>the following code has a couple of issues but the Use of undefined constant includes - assumed 'includes' is annoying me and I don't know whats wrong.</p>
  
  <pre><code>&lt;?php
  
  //Debug Error Reporting Configuration
  error_reporting(E_ALL);
  
  
  /*
      Do Not Change any of these items unless 
      you know what they do and you realy 
      have to change them
  */
  
  //Global Function to return includes path
  function includes($path, $location){
      return $_SERVER['DOCUMENT_ROOT']. "/" .$path. "/" .$location;
  }
  
  //Global Function to return single location path
  function location($path){
      return $_SERVER['DOCUMENT_ROOT']. "/" .$path;
  }
  
  //Global Functions Include
  require(includes(includes, 'functions.php'));
  
  //Messaging Array
  $messages=array();
  
  //Database Configuration &amp; Connection
  $dbhost="localhost";
  $dbuser="root";
  $dbpass="SaltWater";
  $dbname="platform";
  
  connectToDB();
  
  //Session Variable Registration
  session_register("f_name");
  session_register("user_id");
  session_register("company_id");
  
  //Smarty Template Engine Configuration
  define('SMARTY_DIR',  includes(includes, smarty));
  require(SMARTY_DIR . 'Smarty.class.php');
  
  $smarty = new Smarty();
  $smarty-&gt;setTemplateDir(location(templates));
  $smarty-&gt;setCompileDir(location(cache));
  $smarty-&gt;setCacheDir(location(cache));
  
  
  function errorsys($type, $detail){
  
      $smarty-&gt;assign('type',$type);
      $smarty-&gt;assign('detail',$detail);
      $smarty-&gt;display('error.tpl');
  }
  
  ?&gt;
  </code></pre>
  
  <p>EDIT:
  Is there an easier way that I have not discovered yet to make a smart way to do my includes without the usual drill down in folders, in case this gets deployed onto a different server?</p>