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 2 of 2
  1. #1
    DSC
    DSC is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    4
    Member #
    691
    I don't even know if this is the right place for this but it seems to fit better here than anywhere else

    So I have a header that I want to use on every page, no problem I have that working fine using php. BUT my problem comes in when I have pages in other directories. www.sitename.com/index.php ok my header has a link saying home that links to 'index.php', a link to the forum that links to '/f/index.php' and other links to other pages...standard like all sites.
    My problem is, when I click on the link to the forum I am now in 'www.sitename.com/f/' so when I click the home link it links to the index.php within the /f directory and when I click on forum it doesn't find anythign because /f/index.php doesn't exist while already in the /f directory making it /f/f/index.php.

    How do I get around this w/out actually linking to the full www.sitename.com/page.php or making a different header anytime I have something in a subdirectory?

    For now I just have a different header for anything 1 level up linking to /../index.php but I'd really rather not have to do that.

    Thanks in advance!

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    What I do is specify a relativity variable before each URL. Then all links are based on that. For example:
    PHP Code:
    $relativity "../";
    require(
    "header.php"); 
    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 06:05 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com