从有效的PHP生成的HTML会产生iframe验证错误

I have PHP code that validated perfectly in most PHP validators. However, when I visit the site and inspect-element to copy the HTML into a HTML validator, I get a whole bunch of errors - mainly to do with iframe. I've got nothing to do with iframe in my php code which is why I'm confused about this. Could anyone please help shed some light on this? It's happening to all of my pages and this assignment is due tomorrow so any help is greatly appreciated. One example of PHP:

<?php
    //addSuccess
    include("include/header.php");

    //Makes sure user is logged in. If not, ends the script
    if ($logged_in == false) {
        print("Access denied!");
        die();
    } else {
        header("Refresh:3;url=add.php");
    }
    ?>

    <div id="success" class="mid">
        Successfully added/linked entry. Redirecting to add page...
        <p>
        (Click <a href="add.php">Here</a> if your browser does not automatically redirect you.)
    </div>

    <?php include("include/footer.php"); ?>

Generated HTML when not logged in:

<html lang="en"><head>
    <meta charset="utf-8">    
    <title>G.S.DB</title>
    <meta name="author" content="Author name">
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/styles.css">
</head>


<body data-feedly-mini="yes"><header>
    <img src="images/logo.png" alt="Good Show Database">
</header>


<div id="nav" class="centre" ;="">
<nav>
    <ul>
        <li><a href="index.php">Home</a></li>
        <li><a href="login.php">Login</a></li>          <li><a href="search.php">Search</a></li>
        <li><a href="shows.php">Show list</a></li>
        <li><a href="cast.php">Actor list</a></li>
                </ul>
</nav>
</div>




    <div id="main">Access denied!</div><iframe frameborder="0" scrolling="no" style="border: 0px; display: none; background-color: transparent;"></iframe><div id="GOOGLE_INPUT_CHEXT_FLAG" input="" input_stat="{&quot;tlang&quot;:true,&quot;tsbc&quot;:true,&quot;pun&quot;:true,&quot;mk&quot;:false,&quot;ss&quot;:true}" style="display: none;"></div><div id="feedly-mini" title="feedly Mini tookit"></div></body></html>

If you're just looking to validate your HTML, there's no need to inspect the elements of your website and copy that into a HTML validator.

Since PHP is a server-side language, it will be executed before the client-side code (CSS, HTML) is sent to the browser. So just validate your HTML via https://validator.w3.org/nu/ (just put your link in the input there, and it'll check your HTML), it will not be able to see any PHP-code.