Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 10-01-2010, 08:28 PM   #1
New Member
 
Join Date: Jul 2009
Posts: 4
Default PHP include navbar - multiple directories

what is the best practice to link to a page within the site from 2 different levels of directory

ex.

site.com/path/to/file/1.html

and

site.com/path/to/listing.html

both of those need to have a link to "site.com/index.html" I am using an navbar which is being included via php so i have to have the same link for the whole site. is my only option to use the full url for the page?

http://www.site.com/index.hml ?
mattbtay is offline   Reply With Quote


Old 10-04-2010, 05:20 PM   #2
Gold Member
 
Join Date: Nov 2009
Location: New York
Posts: 370
Default

Just use the full URL, I think it would be better for SEO anyhow.

But to solve your problem I've had to do this before. What I ended up doing was using a PHP variable that stores the current page ($_SESSION['page'] = 'home' BEFORE the include) and you can echo the links you want based on that page in your header PHP.
__________________
Submit to my Website Gallery | NY Web Design
bcee is offline   Reply With Quote
Old 10-08-2010, 07:54 PM   #3
Bronze Member
 
Join Date: Jun 2009
Posts: 31
Default

you may have some issues using the full path as someservers wont allow it. that said its the easiest way of doing what you want if yourserver supports it
__________________
Yorkshire website design solutions by Web Design Sheffield. Hosting Solutions by UK Hosting.
web_design is offline   Reply With Quote
Reply

Tags
include, navigation, php

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



All times are GMT. The time now is 07:59 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.