Currently, for things like a header, footer or common sidebar object, I create a custom `.php` file and do something along these lines:
echo '
';
and then include it on the pages that I want it to appear:
include('path/to/file');
The only problem with this is that someone can point their browser to my `.php` file and view part of html on its own. It isn't a huge deal, but it seems unprofessional and a little careless. Is there a better way of doing this? We had a related question just minutes ago: stackoverflow.com/questions/8189834/phpdefined-or-exit
以上就是Easy and efficient way of breaking up html code into several files and using php's include()的详细内容,更多请关注web前端其它相关文章!