Including PHP FilesFiles that are included or required are interpreted as HTML code unless the PHP beginning and end tags are present at the beginning and end of the file.
ExampleIn most of my programs, I like to keep an include file that contains variables which may change. For example, when I interface to my SQL database, I create variables that I can used to refer by number to my database fields. This way, if I move a field in the database, or delete a field causing other field offset values to change, I will only need to change my file that is included in all other files. Below is the include statement in the code.
<?php My phpvars.inc.php file contains: <?php $sitename="My Site"; $siteurl="http://www.mysite.com"; $urln=0; $sitetitlen=1; $descn=2; $approvn=3; $activen=4; ?> |