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

Path to include file

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

"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

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.