![]() |
| Adobe Forums » Adobe Influences » Dynamic Html » Re: How to work with php require_once? |
| Tags: |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
All links in the TEMPLATE file should be one of three kinds -
1. Relative to the template file, e.g., <a href="../ (meaning that you must go up one level from the template folder to reach the root of the site, hence all other files, since none of them should be in the templates folder) 2. Relative to the site root, e.g., <a href="/ (meaning that one would begin looking for the linked file at the root of the site and follow the pathing from that point) 3. Absolute, e.g., <a href="http:// (meaning that the link is to a page external to the site). If your template contains a link that doesn't look like one of these three, then that link is improperly made. With regard to the specifics, you cannot really use either of the latter two in your php include, without some adjustment as Micha notes. -- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "cscampste" <webforumsuser@macromedia.com> wrote in message news:gab14l$aub$1@forums.macromedia.com... > Hello, > > I need to include the following line in all my php files - <?php > require_once('connections/sqlconnect.php'); ?>. I'm using a dreamweaver > template and all my documents are based on this. whenever I create a new > document it updates all the paths to external files referenced in the > document, > for instance the css file. > > The problem is that the php line require_once doesn't get updated so if I > create documents based on the template in sub folders the path still stays > as > 'connections/sqlconnect.php' instead of '../connections/sqlconnect.php'. > > How do people get around this problem? I thought about using an absolute > path > e.g. www.mywebsite/mypage/connections/sqlconnect.php but if I ever need to > change the location I would have to go through and alter the path in the > documents. > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|