Jump to content
Larry Ullman's Book Forums

Question For Script 12.7 How Can Html File Execute Php Code?


Recommended Posts

Hi Larry:

 

You mentioned that The header.html is being included by PHP. Do you mean in the index.php file --

 

<?php #  index.php

$page_title = 'xxxxx';
include ('./includes/header.html');
?>
 
so that header.html code is part of the original php script?? If so why when i type php code in header.html file with netbeans, there is no code hint, and also the php code color is light blue?
Link to comment
Share on other sites

Also remember that PHP is an interpreted language. That means that PHP code is executed by a interpreter, not from a compiled source. The file extension .php has no special functionality. The interpreter might also run .html, .txt or .randomExtension as PHP if you can just tell PHP and Apache to treat it that way.

 

This article might clear some things up:

http://php.about.com/od/advancedphp/p/html_php.htm

Link to comment
Share on other sites

 Share

×
×
  • Create New...