3
Contributors
5
Replies
8
Views
6 Years
Discussion Span
Last Post by diafol
0

Where is php.ini? I only have ftp access to this server, so I doubt I can change (or even see) that file. Is there anything else I can do?

0

The 'absolute include' is trying to access webroot. A dirty solution would be:

include($_SERVER['DOCUMENT_ROOT'] . "/r1/schenectady/header.php");

However, I've recently learned that this isn't the best way to do things.

A relative solution would be best if you're not accessing the include from another include. That is, if your include statement exists inside a file which is itself an include file. If so, you'll have to reference it relative to the 'ultimate parent page'. An added complication to relative references is if a number of files, in different locations include a file, which includes another file. That's when an absolute reference can save your bacon.

0

Great, it works. A bit awkward/annoying, but it works :) Why do you say "this isn't the best way to do things"?

0

I think it's because some virtual paths can differ from the expected. I don't really know to be honest, I was told this by somebody (far more proficient than me) recently. It's always worked for me though.

There was talk of using

dirname(__FILE__)

for the webroot, but that only gives me the path for the current document, not the path include file. So, I can't see how to use it. Anyway, hope somebody out there can elucidate.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.