Jump to content
Larry Ullman's Book Forums

Recommended Posts

HI,

 

In chapter 12 we edited the header.html script and included for link 5 a php conditional.

 

I thought that in order to process php the file extension had to be .php?

 

However the script works perfectly. 

 

I must be wrong about the necessity of the .php file extension?

 

Thanks,

 

Steve

 

Link to comment
Share on other sites

Good question! In order for the code to be processed as PHP, it has to use an extension that the web server recognizes as PHP. This is normally .php. However, the header.html script is included by a .php file, so it's as if the code in header.html is part of index.php (or whatever). If you ran header.html directly, it shouldn't execute the PHP code.

Link to comment
Share on other sites

 Share

×
×
  • Create New...