/    Sign up×
Community /Pin to ProfileBookmark

In meta or header via PHP?

Hi,

Which method should I include the following information? Or which method should I use for which information?

[code=php]header(“Content-Type: application/xhtml+xml; charset=UTF-8”);
header(“Content-Style-Type: text/css; charset=UTF-8”);
header(“Content-Script-Type: text/javascript; charset=UTF-8”);
header(“Content-Language: en”);
[/code]

[code=html]
<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=UTF-8″ />
<meta http-equiv=”Content-Style-Type” content=”text/css; charset=UTF-8″ />
<meta http-equiv=”Content-Script-Type” content=”text/javascript; charset=UTF-8″ />
<meta http-equiv=”Content-Language” content=”en” />[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@felgallAug 11.2006 — Use headers whereever possible as they get processed by the browser before starting to load the page. Using meta tags means that the browser has to make assumptions about the content until it reads enough of the page to see the answer by which time it may be too late to apply it.
Copy linkTweet thisAlerts:
@MoldarinauthorAug 11.2006 — Thanks felgall!

Do you know about any way to check which headers a specific Webpage sends out?
Copy linkTweet thisAlerts:
@bokehAug 11.2006 — Do you know about any way to check which headers a specific Webpage sends out?[/QUOTE]Request the page and read the headers.
×

Success!

Help @Moldarin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...