简体   繁体   中英

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

I'm trying to include the header at the top of my pages, but it gives me a blank screen. When I remove it the PHP file runs and shows the content:

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

What's going wrong?

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

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

Since you're using "include" and not "require", the white screen means you have an error in header.php itself. Use error reporting to narrow the issue down and fix the root of the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM