I have the following code inside the body of my index.php page:
echo "Begin <br />";
include('test.shtml');
echo "Importing dbRead.php here <br />";
include(dirname(__FILE__) . '/dbRead.php');
echo "We have included dbRead.php here <br />";
The output on the page is:
Begin
Inside test.shtml
Importing dbRead.php here
The files are all in the same directory. What’s going on?
EDIT: dbRead.php is a class. It is parsed just fine by my WAMP server, but not the web server after I upload. It contains a single class with properly formed methods and a constructor.
As far as I see all the echos are executed before
include(dirname(__FILE__) . '/dbRead.php');, but no echo output is visible after that. There are some possibilities, for example:dbRead.phpyou use for exampleob_start();(see documentation), thus the echo is executed, but not sent to the browser,dbRead.php, but you have error reporting turned off (see documentation),exit(see documentation) ordie()(see documentation) within the included file,