How to include
Posted: Wed Aug 04, 2010 12:36 pm
Hi there,
I have a free hosting package at one free host provider. Say my url is http://stockpedia.110mb.com. So at first I had the following file structure in my vista panel:
Directory tree: root/
(folder)htdocs
(file)DO NOT UPLOAD FILES HERE
Then I purchased a domain say stockpedia.com and add-on it to the free host. So my previous file structure became this:
Directory tree: root/
(folder)htdocs
(folder)stockpedia.com
(file)DO NOT UPLOAD FILES HERE
If I click (folder)stockpedia.com then it contains the following structure:
Directory tree: root/stockpedia.com
(folder)UP..
(folder)htdocs
My question is, here this htdocs is the root directory for stockpedia.com domain or not?
If it is the root directory for stockpedia.com domain then I want to have a folder outside of the root directory and want to include files from that folder so that files remains in this folder cannot be directly accessible. Say I made a folder "includes" outside of the directory htdocs. So the structure became this:
Directory tree: root/stockpedia.com
(folder)Up..
(folder)htdocs
(folder)includes
Now my index file for the stockpedia.com will be inside "htdocs" folder and suppose I have putted header.php and menu.php files inside that includes folder. Now I want to include those header.php and menu.php file in index file which is under htdocs folder. I wrote this code to include:
[file: index.php]
<?php
include("/includes/header.php");
include("/includes/menu.php");
echo "This is my index page for stockpedia.com";
?>
but the index file is unable to include those header or menu.php. My second question is what should I write to include those files in index page?
I have a free hosting package at one free host provider. Say my url is http://stockpedia.110mb.com. So at first I had the following file structure in my vista panel:
Directory tree: root/
(folder)htdocs
(file)DO NOT UPLOAD FILES HERE
Then I purchased a domain say stockpedia.com and add-on it to the free host. So my previous file structure became this:
Directory tree: root/
(folder)htdocs
(folder)stockpedia.com
(file)DO NOT UPLOAD FILES HERE
If I click (folder)stockpedia.com then it contains the following structure:
Directory tree: root/stockpedia.com
(folder)UP..
(folder)htdocs
My question is, here this htdocs is the root directory for stockpedia.com domain or not?
If it is the root directory for stockpedia.com domain then I want to have a folder outside of the root directory and want to include files from that folder so that files remains in this folder cannot be directly accessible. Say I made a folder "includes" outside of the directory htdocs. So the structure became this:
Directory tree: root/stockpedia.com
(folder)Up..
(folder)htdocs
(folder)includes
Now my index file for the stockpedia.com will be inside "htdocs" folder and suppose I have putted header.php and menu.php files inside that includes folder. Now I want to include those header.php and menu.php file in index file which is under htdocs folder. I wrote this code to include:
[file: index.php]
<?php
include("/includes/header.php");
include("/includes/menu.php");
echo "This is my index page for stockpedia.com";
?>
but the index file is unable to include those header or menu.php. My second question is what should I write to include those files in index page?