Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Server side includes inside of includes?
Old 10-22-2009, 12:26 AM Server side includes inside of includes?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
I'm new to php. After some experimentation, I have found that I can have a php include file inside of another php include file, and it seems to work.

1st level: Page on site
2nd level: Include file
3rd level: Include file (shows up on Page on site)

This feature did not seem to work for me when using ss includes in web pages with .html extensions.

I was wondering if having includes inside of includes (in .php files) is an OK, are there any problems I might run into with this type of arrangement? It's helpful for me because I get to separate pieces of code which makes it easier to modify down the road. Thank you for any suggestions.
andrew99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-22-2009, 01:17 AM Re: Server side includes inside of includes?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
In php it is quite normal to include files with includes.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 10-22-2009, 01:41 AM Re: Server side includes inside of includes?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
Thanks for the heads up. Php seems so much more powerful than standard html - can't see why more sites don't use it.
andrew99 is offline
Reply With Quote
View Public Profile
 
Old 10-22-2009, 01:44 AM Re: Server side includes inside of includes?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
You know, html is hyper text markup language while php is fully functional programming language. Generally speaking, html page is the result of php script's work, that's why you don't see php in html code. Including files with includes is the most simple thing that php can do.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 10-22-2009, 01:53 AM Re: Server side includes inside of includes?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
Oh I know, php is powerful. I've done some crazy stuff with it (registration sites, etc), although I'm still missing some of the basics (as you can tell)
andrew99 is offline
Reply With Quote
View Public Profile
 
Old 10-22-2009, 05:05 AM Re: Server side includes inside of includes?
lizciz's Avatar
Webmaster Talker

Posts: 744
Name: Mattias Nordahl
Location: Sweden
Trades: 0
And just as an extra tip, in case you didn't know already. For both the include() and require() functions there are equivalent functions that will only include pages once, include_once() and require_once(). So if you get caught up in big nested includes where two includes in turn includes the same page it will still only be included once. This would prevent error messages saying you're trying to define functions which already exists for example.

So this is good to use when including pages with functions in it, or classes.
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Server side includes inside of includes?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23097 seconds with 12 queries