Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[1658] Implementing a template based website

Last post 06-02-2005 9:58 AM by aaron123nz. 15 replies.
Page 2 of 2 (16 items) < Previous 1 2
Sort Posts: Previous Next
  • 06-02-2005 9:58 AM In reply to

    using include with a php marked-up htm template

    I have been trying to use php's inlude to include a template file which has been marked up with some php variables.  However when using include() the php parsing drops out.  This code keeps the parsing on.  Hope its of use to someone.

    $buffer = addslashes(get_include_contents('resultspage.htm'));
    eval("echo \"".$buffer."\";");

    function get_include_contents($filename) {
      if (is_file($filename)) {
          ob_start();
          include $filename;
          $contents = ob_get_contents();
          ob_end_clean();
          return $contents;
      }
      return false;
    }


    results page.htm:
    ....
                 <TD>{$output[num_responses]}</TD>
    ....
    • Post Points: 0
Page 2 of 2 (16 items) < Previous 1 2