My host recently disabled php includes, and i use one on every page. What is weird is that my forum still works (i use phpbb) and i know for a fact that it uses includes. So whats up, is there some work around that i don't know about? I know I'm doing the includes right, because they worked for along time before, and when i actually paste what is supposed to be included into the file be hand it works fine.
If your host truly disabled includes somehow (I'm not sure how, since it is a language construct and not a function), then it's time to find another host. My suspicion though is that it's more likely something like disabling URL wrappers for include or something similar that is preventing your includes from loading the desired files. But that's all speculation without any details and specific error messages.
NogDog wrote:If your host truly disabled includes somehow (I'm not sure how, since it is a language construct and not a function), then it's time to find another host. My suspicion though is that it's more likely something like disabling URL wrappers for include or something similar that is preventing your includes from loading the desired files. But that's all speculation without any details and specific error messages.
I don't get an error message, it just loads a blank page. I checked the source and it is also blank. I am currently looking for a new host, but i'd rather just try to get this one to work.
Add the following to the top of your script and see if it gives you any more info:
<?php ini_set('display_errors', 1); error_reporting(E_ALL);
NogDog wrote:Add the following to the top of your script and see if it gives you any more info: <?php ini_set('display_errors', 1); error_reporting(E_ALL);
I still get a blank page. Here's what i put:
<?php ini_set('display_errors', 1); error_reporting(E_ALL); include("http://www.mysite.com/header.txt"); ?> ***content*** <?php include("http://www.mysite.com/footer.txt"); ?>
Do you see anything wrong with it?
Try including them using relative path (../ ) instead of absolute ("http://...") like this:
<?php include("header.txt"); ?> <?php include("footer.txt"); ?>
Your web host probably disabled URL wrappers. I'm not sure 🙂
Instead of using a URL, try using a filesystem path, e.g.:
include $_SERVER['DOCUMENT_ROOT'].'/header.txt';
(This would be consistent with them disabling URL fopen wrappers.)
NogDog wrote:Instead of using a URL, try using a filesystem path, e.g.: include $_SERVER['DOCUMENT_ROOT'].'/header.txt'; (This would be consistent with them disabling URL fopen wrappers.)
Yes! It works!!!!! Thank you 😃 thank you 😃 thank you 😃 thank you 😃 thank you 😃 thank you!