This is a discussion on wrong directory within the PHP Language forums, part of the PHP Programming Forums category; Hello, I have a calendar on my site in an extra directory <calendar> in root i have a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I have a calendar on my site in an extra directory <calendar> in root i have a site where i include the calendar with:<?php include("calendar"); ?> which works fine so far but the calendar contains links to files in the calendar directory but now it tries to find this files in the root directory why? Is there a easy way to fix that? If I move all the files to the root directory it works fine but it becomes chaotic. I appreciate any help. Thanks chris |
|
|||
|
Chris wrote:
> Hello, > > I have a calendar on my site in an extra directory <calendar> in root i have > a site where i include the calendar with:<?php include("calendar"); ?> which > works fine so far but the calendar contains links to files in the calendar > directory but now it tries to find this files in the root directory why? Is > there a easy way to fix that? > If I move all the files to the root directory it works fine but it becomes > chaotic. Try adding the calendar directory to the include path: <?php // calendar $calendar_dir = '/home/chris/public_html/calendar/'; set_include_path(get_include_path() . ':' . $calendar_dir); ?> If you're using windows, I guess the path separator should be ";" -- I have a spam filter working. To mail me include "urkxvq" (with or without the quotes) in the subject line, or your mail will be ruthlessly discarded. |
|
|||
|
Could also modify the include directives to point to the literal path...
include_once("/home/mysite/public_html/calender/myfile.php"); Rather than just include_once("myfile.php"); Pedro <hexkid@hotpop.com> wrote in message news:<bnk275$11scd7$2@ID-203069.news.uni-berlin.de>... > Chris wrote: > > Hello, > > > > I have a calendar on my site in an extra directory <calendar> in root i have > > a site where i include the calendar with:<?php include("calendar"); ?> which > > works fine so far but the calendar contains links to files in the calendar > > directory but now it tries to find this files in the root directory why? Is > > there a easy way to fix that? > > If I move all the files to the root directory it works fine but it becomes > > chaotic. > > Try adding the calendar directory to the include path: > > <?php // calendar > $calendar_dir = '/home/chris/public_html/calendar/'; > set_include_path(get_include_path() . ':' . $calendar_dir); > ?> > > If you're using windows, I guess the path separator should be ";" |
|
|||
|
No thats not it.
It still tries to find the images and links from the calendar directory in the root directory. Thanks for the thought "Steve" <gr82meetu78@yahoo.com> wrote in message news:bb8f15bd.0310271947.29aee39b@posting.google.c om... > Could also modify the include directives to point to the literal path... > include_once("/home/mysite/public_html/calender/myfile.php"); > Rather than just > include_once("myfile.php"); > > > Pedro <hexkid@hotpop.com> wrote in message news:<bnk275$11scd7$2@ID-203069.news.uni-berlin.de>... > > Chris wrote: > > > Hello, > > > > > > I have a calendar on my site in an extra directory <calendar> in root i have > > > a site where i include the calendar with:<?php include("calendar"); ?> which > > > works fine so far but the calendar contains links to files in the calendar > > > directory but now it tries to find this files in the root directory why? Is > > > there a easy way to fix that? > > > If I move all the files to the root directory it works fine but it becomes > > > chaotic. > > > > Try adding the calendar directory to the include path: > > > > <?php // calendar > > $calendar_dir = '/home/chris/public_html/calendar/'; > > set_include_path(get_include_path() . ':' . $calendar_dir); > > ?> > > > > If you're using windows, I guess the path separator should be ";" |