Need help with includes

I am trying to use includes in my website for my navbar header ect.
Ok I made it work by putting this config file in the directly htdocs folder which is the root directry of my local host (mamp)
But that means i have to put all my files directly in htdocs. How i need it to work is to have each website in there own folder
The same thing happens when i upload my site to my server to get all my includes to work i need to put my website directly on the root directory of the server.

this is my code I have one include at the top of every page of my website. If i need to put my website on the web i change the two first lines of the code.

<?php define('SERVER_URL','http://localhost:8888/'); define('APP_FOL','/my_site/'); define('APP_URL',SERVER_URL.APP_FOL); define('SERVER_DOC_ROOT',$_SERVER['DOCUMENT_ROOT']); define('APP_DIR',SERVER_DOC_ROOT.APP_FOL); define('INCLUDES_DIR',APP_DIR.'inc/'); define('LIB_DIR',APP_DIR.'lib/'); define('UPLOADS_DIR',APP_DIR.'uplaods/'); define('UPLOADS_URL',APP_URL.'uploads/'); ?>

to use my includes in my page i put

<?php include(INCLUDES_DIR."header.php"); ?>

any help would be great
cheers Mitch

Sponsor our Newsletter | Privacy Policy | Terms of Service