By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,827 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,827 IT Pros & Developers. It's quick & easy.

wrong directory

P: n/a
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

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
Jul 17 '05 #2

P: n/a
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 <he****@hotpop.com> wrote in message news:<bn*************@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 ";"

Jul 17 '05 #3

P: n/a
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" <gr*********@yahoo.com> wrote in message
news:bb**************************@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 <he****@hotpop.com> wrote in message

news:<bn*************@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 ";"

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.