php - How to insert content in a header of web page from other file? -
i have problem included header in phtml file. have mvc project , view file builded this
<?php require_once'header.phtml'; //some php command print stuff reuire_once 'footer.phtml'; ?> when press f12 in google chrome header content apears in body of page, :
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> <style type="text/css"></style></head> <body> <title>userlist</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <link rel="stylesheet" type="text/css" href="../css/mystyle.css"> <meta name="description" content="mvc minishop project"> <meta name="keywords" content="mvc online store"> <meta name="author" content="vasile vetisan"> <meta charset="utf-8"> <div class="menu"> <ul> <li><a href="#">home</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> </ul> <br style="clear:left"> </div>user list is:<br> <table border="1"><tbody><tr><td>user_id</td><td>first_name</td><td>last_name</td><td>username</td><td>email</td><td>password</td></tr><tr><td>2</td><td>test</td><td>unu</td><td>test1</td><td>test1@gmail.com</td></td></tr></tbody></table> </body></html> even if change structure of viewuser page this:
<html> <header> <?php require_once 'header.phtml' ?> </header> <body> //some generated stuff php </body> </html> the result same previous :( . summary of post need method insert content in header of phtml page page using php or phphtml extenxions. have tried lot of stuff need new ideas or answers.
i think good, easy , effective way of including parts using php, part.html file code.
<?php include "part.html"; ?> example:
part.html
<p> hello world! </p> index.php
<body> <?php include "part.html"; ?> </body> output should be
<body> <p> hello world! </p> </body>
Comments
Post a Comment