Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: Include Paths

  1. #1
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    Ok...now Ive had this problem before.

    I have my site root, ok....now

    ROOT
    includes
    customer
    index.cfm

    Now, my includes look like this
    <a href="test.cfm">

    When the menu file is included in index.cfm, the url is
    siteroot.com/test.cfm

    Which is perfect, now if i include the same file in a page in the customer folder
    its siteroot.com/customer/test.cfm

    I do understand why this happens, however i need them to link to
    siteroom.com/file.cfm from both the siteroot pages as well as pages in any subdirectory.

    Ive tried doing <a href="./../test.cfm"> but this seems to use the path of the page im on (i thought it used the path of the includes directory)

    Im using coldfusion btw.
    I know how to do this in php, but cant quite find the CF equiv.

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    Nope, always uses the page in question as a reference. It's not a PHP or CF thing, it's an HTML thing. More really just a folder directory thing actually
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Senior Member
    Join Date
    Dec 2008
    Posts
    483
    Member #
    17875
    Liked
    1 times
    I found the solution to this.
    In php it was actually $SERVER[DOCUMENT_ROOT] + path to file.

    THis seems to work as well:

    <a href="/carp.cfm"> the / brings you back to the root folder (wherever ur ftp logs u in).

    So i link to stuff like this
    <a href="/teammate/index.cfm">

    my site is in
    root
    +teammate folder
    -index.cfm


  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    If you know for certain that the site will be on its own domain or subdomain (i.e., not under a subdirectory), prefixing everything with / is the most reliable and gives you far fewer headaches than relative links.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com