Welcome Guest, Not a member yet? Register   Sign In
https AND outside the systems directory
#1

[eluser]codeamatic[/eluser]
I'm working on a project that requires me to include a third party .php (lets call it x.php) page using "require_once". Unfortunately, that page is outside the system directory and it seems to give me trouble. I can include the file and it will start going through the file as expected but when it approaches the functions file_exists() and dir() it continues to return false even though the include inside of the if/else recognizes that the file exists

Code:
if (file_exists('includes/configure.php')) {
  /**
   * load the main configure file.
   */
  include('includes/configure.php');
} else {
  require('includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
  exit;
}

Any ideas?

p.s. this is also in the Code Igniter Discussion forum, I didn't know how to remove it from their.
#2

[eluser]TheFuzzy0ne[/eluser]
If the file is outside of the system directory, then you cannot possibly include it with the statement you can not possibly include it using the path you're using. You'd need to do something like:
Code:
include('../includes/configure.php');

# OR

include(dirname(FCPATH) . '/../includes/configure.php');




Theme © iAndrew 2016 - Forum software by © MyBB