You are here: Re: Paths and include files problem, please help! « All PHP « IT news, forums, messages
Re: Paths and include files problem, please help!

Posted by Good Man on 04/05/06 19:30

> If one file accesses it from a certain directory it works, but then if
> another file acceses it from yet another directory then it cant find
> it because the path is different !
>
> For example:
>
> the follwoing works for one of my files
>
> include(/includes/include.php');
>
>
> but for another one i have to use this because its in another part of
> the directory structure
>
> include('events/includes/include.php');

actually, i don't believe you. unless you made a typo in that first
example, using it in any other file will work.

paths that START with a / mean that they are coming from the TOP of your
server. You need to find the absolute path to your includes directory;
from what you wrote in your first example, its right at the top of your
server.

for the sake of this example, lets say your includes file was found in
the following directory (starting from the top)
"/home/username/events/includes".

if you put...

include('/home/username/events/includes/include.php');

....at the top of your PHP pages, they will all access it without a
problem.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация