Cliff Main wrote:Dave,
This might be over-simplifying it a bit, but wouldn't this work if the files are local?
<?php
include("somefile.inc.php");
?>
If the path is kept simple, it might work no matter what url fopen is set?
Just a thought.
Cliff,
That would work if the files were in your site's root directory. However, if you were in say
http://www.mysite.com/media/
your suggestion would not work UNLESS somefile.inc.php existed in the /media/ directory as well OR you wrote the include like this
include("../somefile.inc.php");
This presents a new problem as some hosts see this ../ directive as the root of the server which you cannot access as a customer.
When we write includes using absolute to root
include("/www/server/htdocs/myfile.php");
it matters not what our working directory is as the path to the file is "absolute to root", or absolute to the server root directory. You know, the one you can't access using ../ from the root of your site.
Let me explain this way.
http://www.yoursite.com
include("../somefile.inc.php"); // BAD REFERENCE
http://www.yoursite.com/media/
include("../somefile.inc.php"); // GOOD REFERENCE
http://www.yoursite.com/media/ OR
http://www.yoursite.com
include("/www/server/htdocs/somefile.inc.php"); // BEST REFERENCE
That was verbose. Sorry.
Let's not get all hurt.