473,405 Members | 2,210 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,405 software developers and data experts.

Path to include file

Hello,

I want to include an inc file into a number of files residing in different
directories and different directory levels. Apart from setting include_path
accordingly, isn't there a simple syntax to give a path relative to the
document root? "/mypath/myfile.inc" doesn't seem to work...

Thanks in advance,
Thomas

Jul 17 '05 #1
3 1643

"Thomas Mlynarczyk" <bl*************@hotmail.com> wrote in message
news:cc*************@news.t-online.com...
Hello,

I want to include an inc file into a number of files residing in different
directories and different directory levels. Apart from setting include_path accordingly, isn't there a simple syntax to give a path relative to the
document root? "/mypath/myfile.inc" doesn't seem to work...

Thanks in advance,
Thomas

include $_SERVER['DOCUMENT_ROOT'].'/mypath/myfile.inc';

Jeroen.
Jul 17 '05 #2
Also sprach Jeroen Smaal:
include $_SERVER['DOCUMENT_ROOT'].'/mypath/myfile.inc';


Seems to be my only choice then (provider won't let me mess up php.ini).
Still, why doesn't PHP accept "/mypath/myfile.inc" for a path relative to
the doc root? For web documents, this syntax works fine with Apache.

Jul 17 '05 #3
Thomas Mlynarczyk schrieb:
Still, why doesn't PHP accept "/mypath/myfile.inc" for a path relative to
the doc root? For web documents, this syntax works fine with Apache.


PHP is more than an Apache extension.

Regards,
Matthias
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Duncan Bayne | last post by:
Hi All, I have a PHP program that includes files from the 'include' directory relative to the path that translates to the HTTP root of the site. This is '/var/www/html' on the server, and...
3
by: rajuvk | last post by:
I am setting up a website with a number of folders like: / (the document root) /user /admin/ /content in the /user folder there is a flie "userlogged.php", which I want to include in every...
4
by: | last post by:
Is it possible to include my remote web server path eg: m:/html/root/site1 | m:/html/root/site2 etc ....in virtual includes.... Thus eliminating the need to create duplicate INC files in each...
4
by: michaaal | last post by:
I have two folders in my website... Folder1 (this is where my #include file is, this is where the style.css is) --Folder2 (Folder2 is inside of Folder1) Folder2 contains a file that has...
2
by: \A_Michigan_User\ | last post by:
Ok, I give up. I need to #include the same 1 file (IncludeThis.asp) into 3 different asp files. 1> C:\MyDir\ThisFile.asp 2> D:\MyDir\AASubSub\ThatFile.asp 3>...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
1
by: Alex VanderWoude | last post by:
I am trying to <include> some text into an XML documentation topic, but that text is stored in a file that is in a different directory than the "current" XML file. Using a relative path does not...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.