Kahuki Webmaster Forum  

Go Back   Kahuki Webmaster Forum > Website Development & Management > Programming > PHP

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-22-2007, 08:12 PM
Member
 
Join Date: Aug 2006
Posts: 67
sai14 is on a distinguished road
Exclamation In PHP, what function do I use to incorporate the name of files into PHP files?

In PHP, what function do I use to incorporate the name of files into PHP files?

Reply With Quote
  #2 (permalink)  
Old 04-22-2007, 09:01 PM
Member
 
Join Date: Jun 2007
Posts: 68
Big Vern is on a distinguished road
I'm not quite sure I understand your question, but I think you may be talking about the include function. If, say, you wanted to include a footer file at the bottom of every page, you would have to make the following function call:

<? include "footer.php"; ?>

Reply With Quote
  #3 (permalink)  
Old 07-05-2007, 11:51 AM
Rookie
 
Join Date: Jul 2007
Posts: 7
JonPeibst is on a distinguished road
You can use include("path/to/file"); or require("path/to/file");

Reply With Quote
  #4 (permalink)  
Old 07-28-2007, 02:10 PM
Member
 
Join Date: Jul 2007
Posts: 93
webmasterneo is on a distinguished road
Big Vern and Smaaz both said it. If you want to insert the contents of another file into the PHP file you're editing, use either
Code:
include("path/to/file");
or
Code:
require("path/to/file");
The only difference is that when you use "require" and the file being called isn't there or cannot be loaded, the whole page will not render. Whereas in include, there'll just be nothing where that inserted file should be.

__________________
I'd explain it to you; but your head will explode.

Reply With Quote
  #5 (permalink)  
Old 07-14-2008, 05:39 AM
Rookie
 
Join Date: Jul 2008
Posts: 36
Sakari is on a distinguished road
Quote:
Originally Posted by webmasterneo View Post
Big Vern and Smaaz both said it. If you want to insert the contents of another file into the PHP file you're editing, use either
Code:
include("path/to/file");
or
Code:
require("path/to/file");
The only difference is that when you use "require" and the file being called isn't there or cannot be loaded, the whole page will not render. Whereas in include, there'll just be nothing where that inserted file should be.

you mean, include or require function are same. but a little bit difference is there. we can use anyone anytime.


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
does live.com crawl sitemap.xml files? *Anjali* MSN / Live.com 4 09-30-2007 07:48 AM
How to parse .htaccess files as PHP? James L. Dean Web Hosting 2 05-02-2007 02:32 AM
In PHP, what function do you use to incorporate the name of files into PHP files? czjdell PHP 1 04-22-2007 04:23 PM
Why does Webtrends not pick up my files? vjvishy Web Hosting 1 03-09-2007 06:50 PM
Should AVG anti virus be set to scan "all files or scan infectable files ? juneja General Discussions 9 02-12-2007 09:05 PM


All times are GMT. The time now is 12:18 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0