0

I have following directory structure for the project:

enter image description here

Home.php simply includes either of the two views i.e. login or invoice depending upon the session variables.

if (!isset($_SESSION['username'])) {
            include 'views/login.php';
        } else {
            include 'views/invoice.php';
        }

I include my constants file which contain database connection strings and other constants along with a autoloader file which register a autoload function to include all the classes.

include 'includes/constants.php';
include 'includes/autoloader.php';

It works without issues but when i use the same in get_data.php file it gives following error:

Warning: include(includes/constant.php): failed to open stream. No such file or directory.

Same error for autoloader.php too.

Vic Seedoubleyew
  • 9,888
  • 6
  • 55
  • 76
Saurabh
  • 664
  • 2
  • 12
  • 30
  • 1
    I already tried that but it's still the same error. I have tried following two: '../includes/constants.php' and './includes/constants.php' – Saurabh Jul 13 '15 at 14:42
  • Although highly unlikely on Win, will not hurt to check the permission. And have you tried absolute path? – frz3993 Jul 13 '15 at 15:04
  • I would try `../includes/constants.php` – MonkeyZeus Jul 13 '15 at 15:48
  • Possible duplicate of [Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew Sep 10 '16 at 11:05

0 Answers0