How do I call php in another directory

LPH

Well-known member
Code:
<?php include('header.php');?>
<?php include('connect.php');?>
<?php require_once('auth.php');?>

The above code works when I am in the /research directory. A XenForo page is created, this code is placed in the Page Options. Obviously the code isn't directing this page to the /research page.

Since I'm still learning php .. .. can someone direct me to the easiest way to handle this directory challenge. Should I simply add

Code:
<?php include('/research/header.php');?>
<?php include('/research/connect.php');?>
<?php require_once('/research/auth.php');?>

There must be a way to do a path variable ... (um, right words?).

Thanks for any guidance.
 
There must be a way to do a path variable ... (um, right words?).

Thanks for any guidance.

This may be more appropriate. Since it is in the middle of the night and this woke me up... LOL.

Code:
<?php
 define('APP_DIR', '/research'); 
 include(APP_DIR.'header.php');
  include(APP_DIR.'connect.php');
  require_once(APP_DIR.'auth.php');
?>

I'm not sure that will work.
 
Top Bottom