Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old May 31st, 2006, 11:34 AM   #1
WebForumz Member
 

Join Date: Apr 2006
Location: Missouri
Age: 33
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 lesleindotcom will become famous soon enough
PHP Includes

I am used to the nice easy include statements of ASP, why can I not just include files like this?

Code:
<?php require_once('/db/DB.php'); ?>
lesleindotcom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 31st, 2006, 11:43 AM   #2
Highly Reputable Member
 
herkalees's Avatar
 

Join Date: Jul 2005
Location: Massachusetts, USA
Age: 89
Posts: 563
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 herkalees will become famous soon enough herkalees will become famous soon enough
Re: PHP Includes

Yayhooray!
Code:
<?php require("file.html"); ?>
herkalees is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 31st, 2006, 12:07 PM   #3
WebForumz Member
 

Join Date: Nov 2005
Location: England
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 iZone will become famous soon enough
Re: PHP Includes

What you have written is fine in terms of syntax. Its probably a case of not being able to find the file. As a general rule, if the file isnt in the same directory use:

<?php require_once($_SERVER['document_root'].'/db/DB.php'); ?>
iZone is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 31st, 2006, 04:54 PM   #4
Reputable Member
 

Join Date: Sep 2005
Location: Canada, BC
Age: 25
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Pheonix will become famous soon enough
Re: PHP Includes

Quote:
Originally Posted by lesleindotcom
I am used to the nice easy include statements of ASP, why can I not just include files like this?

Code:
<?php require_once('/db/DB.php'); ?>
You can include files like that, however, the file you are calling might not exist in that location as said above, what is the exact error you are reciveing?
Pheonix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
php , includes


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl includes sconard Other Languages 0 August 24th, 2006 09:11 AM
PHP Includes daygon PHP 5 March 15th, 2006 09:59 PM
CSS and includes rewmer HTML, XHTML and CSS 4 August 14th, 2005 06:31 AM
Further Help with Includes freebirdnz Classic ASP 3 August 5th, 2004 09:48 AM
Help with includes. freebirdnz Classic ASP 5 August 3rd, 2004 10:38 AM


Search Engine Optimization by vBSEO 3.2.0 RC8