4 Replies Latest reply on Feb 23, 2013 5:54 PM by bregent

    Same PHP_includes to show up in Root and Subfolder

    AldoA

      Hi,

       

      Trying to figure out the best way to show  the same php includes  on all root and subfolders and

      avoid creating another PHP includes for a Subfolder.

       

      I'm using Dreamweaver PHP Includes files with MAMP…

      everything works fine when using this way from the root to preview on the computer:

       

      Index.php

      about.php

      php-includes/inc_header.php

      subfolder

       

      but when I move about.php using the Manage Site in Dreamweaver

      to subfolder like this:

       

      Index.php

      php-includes/inc_header.php

      subfolder/about.php

       

      Then the about.php page path code looks like this:  <? include("../php-includes/inc_header.php"); ?>

      but since all the CSS or Image path from header coming from the root, now nothing shows up on subfolder.

       

      My root php-includes/inc_header.php is using this code:

      <div id="header"><img src="images/mainheader.png" width="980" height="216" >

       

      The only way for me to show up images/links on subfolder is to re-create another PHP include like

      php-includes/inc_header-subpages.php then replace  the code adding the image path to ../images/ like this:

       

      <div id="header"><img src="../images/mainheader.png" width="980" height="216" >

       

      I hope there is another simple way to manage this?

       

      Thanks