My directory is something like this:
root
../members
../includes
../includes/column
../includes/column/modules
in root i include in the index.php
<?php include "includes/column/right_column.php";?>
the right_column.php also includes various modules like so:
<?php include "includes/column/modules/right_col_yog.php";?>
which basically populate a column on the webpage.
So far this works ok.
My problem is when i want to include the same module/s in a file in the members directory.
I can call
<?php include "../includes/column/right_column.php";?>
Which finds the file "right_column.php", but it dosent find the includes in this file like "right_col_yog.php".
I realise the problem maybe due to using relative path but I am wondering to write absolute paths for this problem and if it is solvable.
Any pointers
absolute paths
Moderator: General Moderators
Re: absolute paths
Just define a path in a config file with your absolute path in it:
Then use it in all your includes
..or just add it into your include dir's in your php.ini
Code: Select all
$include_dir = '/var/www/vhosts/example.com/httpdocs/';Code: Select all
include($includes_dir.'includes/modules/columns/right_col.php');