i have one main directory which has 3-sub directory, named as [ inc, products, and images ],
inc directory consists on three files named as links.php, memberinfo.php, and login.php<br /><br />
products directory consists on file named as ctegory.php, products.php and product detail.php
there is also an main.php on maon directory.<br /><br />
i include [ login.php & member.php ] page from inc directory on each files on the directory of products [ ctegory.php, products.php and product detail.php ], if member is not register then login.php page show else member.php page display including main.php<br /><br />
the problem is that if i manage [ links of links.php ] for main.php then there is problem with inc directory pages, and if i mange [ links of links.php ] according to inc directory then main.php links does't work.<br /><br />
i want to solve this problem so that in no. of directory i can manage no of links by using the single links.php file on each directory<br /><br />
If I correctly understand your problem, probably the two simplest solutions are:
1. Add the "inc" directory to the "include_path" in your php.ini file (or via .htaccess if running on Apache) and then just include by filename.
-- or --
2. Use a full path to all include files, e.g.:
PHP Code:
include $_SERVER['DOCUMENT_ROOT'] . '/inc/links.php';
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks