Using links in include files

I'm developing an ecommerce site that using a top menu bar for 'home, our stores, contact etc' and a side menu bar for departments - shoes, bags etc. I've put both nav menus into include files.

Firstly can someone tell me what I need to put in front of my links to make them absolute (ie. accessible from pages within subfolders).  

Secondly when the user gets to the check out page they are then transferred onto the secure server. If they then choose to continue shopping they need to go back to the original server in order for the cart details to still be there. On a previous site I made the links completely absolute ie, http://www.mysite.co.uk/shoes.php, which got me a round this problem, but is a pain when I'm editing on my testing server. Any suggestions ?
DallySPAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CWS (haripriya)Commented:
if you want to access a file from a subfolder, use this:

include_once('../navmenu.php');
0
Cornelia YoderArtistCommented:
Another possibility, if you need to specify the full path due to the secure server, is to put the path itself in a single variable, and make all the rest of the code use it.

$includepath="http://www.mysite.co.uk/";

include_once ($path."shoes.php");

This will let you modify just one place when you are ready to move the code from your testing server to the secure server.
0
Cornelia YoderArtistCommented:
Er, that is ....

$includepath="http://www.mysite.co.uk/";

include_once ($includepath."shoes.php");
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

DallySPAuthor Commented:
Thats a good idea - I'll have a play with this and see if I can get it to work
0
DallySPAuthor Commented:
Sorted - what I did in the end was create a file called path.php which I've made relevant to both my testing site locally and my remote site. Then included the path file in my navigation include file. Lots of including includes - but works great on both servers. Thanks for your help.
0
Cornelia YoderArtistCommented:
Glad to help, good luck with your project :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.