How to set the html page header to edit index. php & lt; at the end of this post from dd0607 to 2014-01-0601: 42: 27 ;? Phpinclude (includeconn. php); include (header. php); include (footer. php );? & Gt; conn. php & lt ;? How to set html page headers in php
This post was last edited by dd0607 at 01:42:27 on
Index. php
include("include/conn.php");
include("header.php");
include("footer.php");
?>
Conn. php
$host='localhost';
$user_name='root';
$password='123123';
$db='netbox';
$conn = mysqli_connect($host,$user_name,$password,$db) or die("Connect failed: " . mysqli_connect_error());
?>
Header. php
test
Footer. php
When index. php does not load conn. php, the page is displayed normally.
When the conn. after php, the page will add html tags such as html/head/body and remove my header. DOCTYPE/html/head in php, and other contents are all thrown into the body. why?
PS: load conn. php and right-click the page to view the source code. it is normal, but if there is a problem, a blank line is displayed at the top of the page, IE11 and Chrome33 press F12 to view the HTML code and you will find it is abnormal.
I just switched from ASP to PHP. it's okay to write logic like ASP. I don't know where the PHP problem is.
Share: More
------ Solution --------------------
Check conn. php comments row by row