Include file as a variable
I have a template file that uses two different versions of the right colum so I use this code for the right column:
Code:
<div id="right-hm">
<?=$rightcol;?>
</div>
I have created 2 include files called right-hm.html and right-res.html which are on the include path in php.ini. What I would like to do is set the value of $rightcol in the file that runs the template like this: $rightcol = 'right-hm.html'; in which case the above would be:
Code:
<?include($rightcol);?>
But it does not work! The only way I can get the right column to appear is to load the value of $rightcol from a mySQL database. How do you write a command to get to to load from the file instead of the database? I even tried setting $rightcol = 'include("right-hm.html")'; It didn't work.
What am I doing wrong? Thanks, erin