BluegrassLass Posted May 30, 2010 Share Posted May 30, 2010 Howdy all! PHP newbie here =) (I'm sure yall get that alot....) I feel silly asking this as I know the answer must be simple. Not even entirely sure its within the realm of php and not html....I've done plenty of searches but am getting way too many unhelpful results and am not sure what keywords to use to narrow it down. Okay...I have a 150+ page website I'm converting to html's with php includes (via htaccess). One of the php includes is a side navigation pane with (of course) tons of links to pages within my site. I also have several directories. My includes are all in a folder "includes" in the main public_html directory......I refer to them from any page in the site using ($_SERVER["DOCUMENT_ROOT"] . "/includes/header.php") (example). Is there a way to refer to links in a similar fashion? I know about absolute and relative URL's of course....but I need to be able to move and upload these files to different servers and use on my own apache server.....so I'm looking for a way to use "absolute urls" based on the document root (or something comparable) and not the entire http path. Again - I know this must be simple. Please forgive my ignorance =) Thanks in advance for any help or direction. Quote Link to comment https://forums.phpfreaks.com/topic/203360-absolute-url-paths/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 30, 2010 Share Posted May 30, 2010 $_SERVER["HTTP_HOST"] Quote Link to comment https://forums.phpfreaks.com/topic/203360-absolute-url-paths/#findComment-1065381 Share on other sites More sharing options...
BluegrassLass Posted May 30, 2010 Author Share Posted May 30, 2010 Thank you kindly! However, I've tried a variety of different formats and cannot get it to work (even after trying formats others have eventually found to work for them). Is there a particular format I need to use? Is there something I need to have configured in a particular fashion? Quote Link to comment https://forums.phpfreaks.com/topic/203360-absolute-url-paths/#findComment-1065398 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.