Re: link problem

From: Date: Mon, 31 Jul 2006 23:12:54 +0000
Subject: Re: link problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239935@lists.php.net to get a copy of this message
Try something like realpath( dirname(__FILE__)."../" ); __FILE__ should give you the full path of the file being run, dirname() will break the directory path from it and ../ will drop it down one dir ... real path will give you a solid final path. ~Drew On 7/31/06, Ross <ross@aztechost.com> wrote:
I have lots of folders and files some are in the main public_html folder and some are in their own foder. I need to find a way to make all the links relative to the public_html folder For example if I am in the 'gallery' folder, the main index file is located at ../index, however if I om in the contact page which is in the same directory as index the link is just index.php. I want to have one menu and make all the links work without having to enter a full http://www.mydomain/myfolder/myfile.php. I tried $_SERVER['doc_root']; but this gives the full server root. I am sure I have see a way to define directorries using define() or something. Ta. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#239935) next »