Ask your web host. I have been able to keep documents outside of my "www" folder with some web hosts, and others I had no choice but to store it in a sub folder.
One simple thing you can do, is let's say you have your www/production/ folder, simply put a blank file in that folder as index.html and you cannot use a web browser to peruse the other files.
Oh man, it just dawned on me... and now I feel very stupid.
It's a sub domain, and there was one additional folder that I left out of the string, because it doesn't exist in the URL.
Even the first example basically works now, sorry guys, and thank you.
Ok, the echo $_SERVER['DOCUMENT_ROOT']; give me this:
\\\\boswinfs01\\home\\users\\web\\b406\\ez.nancyholston
I tried all these:
<?php include ($_SERVER['DOCUMENT_ROOT'] . '\\components\\Header.php'); ?>
<?php include ($_SERVER['DOCUMENT_ROOT'] . '\components\Header.php'); ?>
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/components/Header.php'); ?>
I get this error:
Warning: main(\\\\boswinfs01\\home\\users\\web\\b406\\ez.nancyholston\components\Header.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
Warning: main() [function.include]: Failed opening '\\\\boswinfs01\\home\\users\\web\\b406\\ez.nancyholston\components\Header.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
I've already tried both of those, I get this with BOTH:
Warning: main(\components\Header.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
Warning: main() [function.include]: Failed opening '\components\Header.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
I cut and pasted your exact line, I get this error:
Warning: main(\\boswinfs01\home\users\web\b406\ez.nancyholston\components\Header.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
Warning: main() [function.include]: Failed opening '\\boswinfs01\home\users\web\b406\ez.nancyholston\components\Header.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
Members Menu:
Again, the include file is here:
\\boswinfs01\home\users\web\b406\ez.nancyholston\components\Header.php
The file calling the include is here:
\\boswinfs01\home\users\web\b406\ez.nancyholston\admin\menu.php
I am using includes in the main directory. But when I call those includes in a sub folder ("admin" in this case), they simply do not work regardless of all the methods I've tried.
Here is the path to root: \\boswinfs01\home\users\web\b406\ez.nancyholston
I do this:
<?php include "\\boswinfs01\home\users\web\b406\ez.nancyholston\components\Header.php" ?>
I get this error:
Warning: main(\boswinfs01\home\users\web\b406\ez.nancyholston\components\Header.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b406\ez.nancyholston\_fr\admin\menu_members.php on line 1
I've tried this as well
include $_SERVER['DOCUMENT_ROOT']."/components\Header.php"
But I get the same error.
I've always programmed in ASP. I read that Windows servers base the path on the folder you are in, whereas Linux will base it on the root.
Anyway, I'm sure there is a simple fix.
Thanks
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.