473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

wrong directory

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
3 2271
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Carmine | last post by:
When I issue a db2 list db directory command, most of the node names are wrong. Is this a bug in Db2 v7 or is there something that I am missing? Thanx...
2
by: chiara | last post by:
Hi! This is a piece of a code I wrote. It was perfectly working but now it is giving me some problems I can not understand. I scan a directory (ss_data) and I count its alaments. then I print...
10
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
8
by: Hasani | last post by:
OK, I'm trying to programmatically create an Access database/mdb file but CreateDb(string) always returns false. I don't know what I'm doing wrong, is it my extern signature? Thx in advance ...
8
by: Dmitry Korolyov | last post by:
ASP.NET app using c# and framework version 1.1.4322.573 on a IIS 6.0 web server. A single-line asp:textbox control and regexp validator attached to it. ^\d+$ expression does match an empty...
2
by: Phil Certain | last post by:
Hi, Relative newbie to .Net but experienced with classic ASP. I am trying to create a simple business object to contain commonly used functions. This is what I have done: 1 - Created a simple...
2
by: Zytan | last post by:
You can download them here: http://msdn2.microsoft.com/en-us/vstudio/aa718338.aspx This snippet seems wrong: Visual C# 2005 Code Snippets -filesystem -Search a Directory for Files Recursively ...
2
by: GaryDean | last post by:
The following command... string DebugString = System.Web.HttpContext.Current.Server.MapPath("App_Themes"); is executed from my ThemeManager.cs class in my App_code directory It returns......
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: okonita | last post by:
Hi all, I am having a DB2 connectivity problem that I hope someone can help me resolve. I need this to test Replication and such other things. What am I doing wrong here? Any help that I can get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.