Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: Kraken Kratom Red Vein Kratom   Myyco.com Golden Teacher Liquid Culture For Sale

Jump to first unread post Pages: 1
Offlinewilshire
free radical
Male User Gallery

Registered: 05/11/05
Posts: 2,421
Loc: SE PA
Last seen: 14 years, 3 months
html head using a php include function?
    #8154359 - 03/16/08 06:08 PM (16 years, 2 months ago)

i'm making a website and using php include functions to load content that is common across pages.

is there any reason why this shouldn't be done for the head?

also, i've noticed that in a lot of websites, the URL's are missing file extensions. is there a good reason that people do this?


--------------------


Extras: Filter Print Post Top
Offlineectolysergic
Stranger
Registered: 02/23/08
Posts: 42
Last seen: 15 years, 8 months
Re: html head using a php include function? [Re: wilshire]
    #8155018 - 03/16/08 08:51 PM (16 years, 2 months ago)

if what you are including goes in the head tags sure
otherwise just include it in the body

Extras: Filter Print Post Top
Offlinebeatyou
one
 User Gallery


Registered: 02/21/06
Posts: 618
Loc: austin, tx
Last seen: 2 years, 9 months
Re: html head using a php include function? [Re: ectolysergic]
    #8155742 - 03/16/08 11:37 PM (16 years, 2 months ago)

the reason people are taking off file extensions in modern webapps/sites is for SEO

www.site.com/products/chairs/leather-beanbag
is better than
www.site.com/products.php?cat=341&prodID=3483942329

this is usually done via mod_rewrite w/ apache

Extras: Filter Print Post Top
OfflineSeussA
Error: divide byzero


Folding@home Statistics
Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 3 months, 8 days
Re: html head using a php include function? [Re: wilshire]
    #8156212 - 03/17/08 05:50 AM (16 years, 2 months ago)

> the reason people are taking off file extensions in modern webapps/sites is for SEO

SEO = search engine optimization

Another reason is for 'security through obscurity' ... though for this reason, it is fairly pointless. (There is no such thing as security through obscurity... it isn't security, it is luck.)

The only real downside to includes (from a performance standpoint) is the overhead of the extra filesystem access. Rather than fetching one file to serve the page, the system may have to fetch three or four files (depending on the number of includes). With caches on the server and optimization engines (such as Zend), these downsides are mostly negated.


--------------------
Just another spore in the wind.

Extras: Filter Print Post Top
Offlineectolysergic
Stranger
Registered: 02/23/08
Posts: 42
Last seen: 15 years, 8 months
Re: html head using a php include function? [Re: Seuss]
    #8156339 - 03/17/08 07:35 AM (16 years, 2 months ago)

the perfomance hit is nearly non-existant. it's a simple apache rewrite rule

Extras: Filter Print Post Top
OfflineSeussA
Error: divide byzero


Folding@home Statistics
Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 3 months, 8 days
Re: html head using a php include function? [Re: ectolysergic]
    #8156358 - 03/17/08 07:48 AM (16 years, 2 months ago)

> the perfomance hit is nearly non-existant. it's a simple apache rewrite rule

I'm talking about a php include, not an apache rewrite rule. However, even an apache rewrite rule can be fairly intensive as the server has to parse a list of regular expressions for every single request (not page, but request).


--------------------
Just another spore in the wind.

Extras: Filter Print Post Top
Invisibletak
geo's henchman
Male User Gallery


Folding@home Statistics
Registered: 11/20/00
Posts: 3,776
Loc: nowhereland
Re: html head using a php include function? [Re: Seuss]
    #8156415 - 03/17/08 08:28 AM (16 years, 2 months ago)

The first time you change your layout without using a single header file, you will be kicking yourself in the ass.


--------------------
The DJ's took pills to stay awake and play for seven days.

Extras: Filter Print Post Top
OfflineSeussA
Error: divide byzero


Folding@home Statistics
Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 3 months, 8 days
Re: html head using a php include function? [Re: tak]
    #8156501 - 03/17/08 09:12 AM (16 years, 2 months ago)

> The first time you change your layout without using a single header file, you will be kicking yourself in the ass.

Yep... this is one of those cases where a slight performance hit is more than worth the massive maintenance headache of not having common parts (headers/footers) in include files.


--------------------
Just another spore in the wind.

Extras: Filter Print Post Top
Offlinebeatyou
one
 User Gallery


Registered: 02/21/06
Posts: 618
Loc: austin, tx
Last seen: 2 years, 9 months
Re: html head using a php include function? [Re: Seuss]
    #8165035 - 03/19/08 12:19 AM (16 years, 2 months ago)

I've started to use CMS for all sites i develop now mainly RadiantCMS & Drupal

Extras: Filter Print Post Top
Jump to top Pages: 1

Shop: Kraken Kratom Red Vein Kratom   Myyco.com Golden Teacher Liquid Culture For Sale


Similar ThreadsPosterViewsRepliesLast post
* Post deleted by Administrator Anonymous 526 1 02/08/03 06:08 PM
by darkfly
* quick apache question Kremlin 367 0 12/10/04 09:06 PM
by Kremlin
* PHP? Crazy! TinMan 1,110 7 09/11/03 10:44 AM
by 3DSHROOM
* Xp, Coldfusion, + Apache nugsarenice 804 8 08/25/05 06:30 PM
by nugsarenice
* setting up apache Vvellum 726 4 03/25/06 03:05 AM
by Seuss
* Want to learn PHP: Book recommendations? Gr8fulJ420 961 6 03/09/06 09:39 AM
by Shdwstr
* PHP NUKE RIPPING Genius 605 3 11/06/04 05:11 PM
by Ythan
* apache/.htaccess help! Krishna 957 6 07/08/05 01:28 PM
by MAIA

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
1,005 topic views. 0 members, 0 guests and 1 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.022 seconds spending 0.004 seconds on 12 queries.