Get Paid to Participate     Twitter     Facebook     Google+
Hosting Discussion
 

Hosting Discussion > Web Hosting Forums > Website Development & Design > php includes from folder to folder
forgot password?


Reply


Old
  Post #1 (permalink)   10-29-2005, 06:56 PM
HD Newbie
 
Join Date: Aug 2004
Location: New Jersey
Posts: 4
Send a message via AIM to epic1231

Status: epic1231 is offline
hey there all - i'm using a HTML site that i converted to php so that I can use the includes for certain scripts i want to run.

i use the following example

<?php include($DOCUMENT_ROOT . "/include/header.php"); ?>
or
<?php include("pm_inc.php"); ?>

the header and footer files are in the /include/ folder and the files i want to call the header and footer to are in the /folder2/ folder..

how do i call these files - using just the same method does not work as listed above, i've also tried public_html/username/foldername/ to no avail.

can someone help me on this?

Thanks,
Bill
__________________
Please consult the rules for signature formatting. Sales ads are not allowed in one's signature.
 
 
 


Old
  Post #2 (permalink)   10-29-2005, 07:25 PM
HD Moderator
 
Join Date: Dec 2004
Posts: 1,725

Status: webfreak08 is offline
PHP Code:
<?
include ("folder/filename.php");
?>
or you could use

PHP Code:
<?
require ("folder/filename.php");
?>

Last edited by webfreak08 : 10-29-2005 at 07:27 PM.
 
 
 


Old
  Post #3 (permalink)   10-29-2005, 07:50 PM
HD Newbie
 
Join Date: Aug 2004
Location: New Jersey
Posts: 4
Send a message via AIM to epic1231

Status: epic1231 is offline
it seems though when the file i am inserting this php into is in another folder seperate from the /include/ folder it does not seem to load the php - when using the code like this isn't it trying to call the php file from a subfolder of the folder the file is in?
__________________
Please consult the rules for signature formatting. Sales ads are not allowed in one's signature.
 
 
 


Old
  Post #4 (permalink)   10-29-2005, 08:17 PM
HD Guru
 
dubs's Avatar
 
Join Date: Jan 2005
Location: Red Sox Nation
Posts: 570
Send a message via AIM to dubs

Status: dubs is offline
Hey Epic, just to let you know.

Quote:
4.2 Participants may not use signatures to run sales ads (including without limitation scams, pricing information and plan descriptions).
__________________
Chris Willson
•Dubaro@gmail.com
 
 
 


Old
  Post #5 (permalink)   10-29-2005, 08:30 PM
HD Wizard
 
ANMMark's Avatar
 
Join Date: Sep 2004
Location: Pennsylvania
Posts: 1,606

Status: ANMMark is offline
we always use:


PHP Code:
<?
include './folder/file.php';
?>
__________________
Mark - Co-President/Lead Developer
avidInteractive Software
The ServeraSuite 2007 Award Winning Professional Server Monitoring Solution - Click here
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: