Search code examples
phpincludewhitespace

PHP - include(); makes blank line


Hey when I add include a file at tag it creates a blank line (grey) like : http://puu.sh/40mvI NOTICE: I have seen few questions like that but they didn't helped me.

<?php require("connection/mysql.php"); ?>
<?php @session_start(); ?>
<?php
if(!isset($_SESSION["language"]))
{
    header("Location: ./language/index.php");
}
else
{
    include("./language/".$_SESSION["language"]);
}
?>
<?php if ( isset($_SESSION["bay_username"]) ) { header('Location: account/'); }?>
<!doctype html>

Language file

<?php

// NoConnect
$lg["ncon_header"]                  = "Bayyak Powered sunucularına şu an bağlanılamıyor.";
$lg["ncon_text"]                    = "Lütfen biraz sonra tekrar deneyiniz. En yakın zamanda sorunu çözeceğiz. İnternet bağlantılarınızı kontrol ediniz. Diğer aygıtlarda da aynı hatayı alıyorsanız lütfen <em>error@bayyakpowered.com</em> adresine bu sorunu bildirin.";

?>

Solution

  • Do the following:

    Open your PHP file in Notepad++, go to Format -> UTF-8 (without BOM)

    For some reason, PHP files with UTF-8 (with BOM) generate this blank line.

    I advise you to convert all your PHP files.