Adobe Forums

Add Me
Adobe Forums » Adobe Influences » Dynamic Html » Re: How to work with php require_once?

Tags:



Reply
LinkBack Thread Tools Display Modes
Re: How to work with php require_once?
  #1 (permalink)  
Old 09-25-2008, 03:18 AM
Murray *ACE*
Guest
 
Posts: n/a
Default Re: How to work with php require_once?

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.
>
>




Reply With Quote


Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Hairstyles | UFO Videos | Bollywood Wallpapers | Poems  | WWE


All times are GMT. The time now is 10:36 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.