When I include files in PHP, does it give me a blank screen?

I am trying to include a heading at the top of my pages, but it gives me a blank screen. When I delete it, the PHP file starts up and shows the contents:

<?php
    include("header.php");
?>

What will go wrong?

+3
source share
2 answers

There is probably an error in this file. try turning on display errors and reporting them:

ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
+5
source

Since you use enable, not require, a white screen means that you have a header.php error itself. Use the error report to narrow down the problem and eliminate the root of the problem.

0
source

Source: https://habr.com/ru/post/1769414/


All Articles