PHP include suddenly not working?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
the server my sites are hosted on had a hard drive failure.
They put everything back to normal... sort of...

I have the index.php file with this code:

include ("nav.html");

And other pages in other directories with this code:

include (" ");

Yet that second one doesn't work suddenly. It used to work just fine before.
Now when these pages load with the include using the full url path the page
stops loading and I get all these bizarre core.##### where # is a random
number in my directories.

Tech support said this:

Regarding the core files:

These core files are called core dumps and were created when a php script
crashes or is unable to run. You can delete these core files. Please check
after some time and if you still see the core files, then you should have
your script checked for any errors that might be causing it to crash.


So why if that include ran fine before does it not run fine now? They also
changed it so that it wasn't an include anymore but rather had the full
navigation on the page which worked but isn't what I want. I wanted the
includes so I would not have to update every page when I changed the
navigation or added to it which will be fairly often.

Any help/thoughts appreciated.


Re: PHP include suddenly not working?

Heidi wrote:
: the server my sites are hosted on had a hard drive failure.
: They put everything back to normal... sort of...

Okay nevermind I found the fix. What I don't get is why the full url didn't
work suddenly when it used to before the crash Sunday.

So now I am using ../nav.html instead of the full path to the nav.html file.


Re: PHP include suddenly not working?

On Mon, 1 Oct 2007 00:51:51 -0500, Heidi put finger to keyboard and

Quoted text here. Click to load it

They may have disabled URL includes. It's a security risk anyway, as
well as being an unnecessary overhead on the server. It's far better
to to use file paths, either relative or absolute, than URL paths.

If you don't know the full absolute file path (which you may well not,
on a shared host), then you can get the server to fill that in for you
by using this type of construction:

  include($_SERVER['DOCUMENT_ROOT'] . "/myfile.html");

which is equivalent to a URL include of

  include (" ");

and will work from any page on the site, even in a subdirectory.

-- - read and share comments and opinons
"I don't care if it hurts, I want to have control"

Site Timeline