/    Sign up×
Community /Pin to ProfileBookmark

Hide the doctype for everything but Opera?

So I have to leave the doctype off of my website. It screws with the content management system when the user is logged in. However because the doctype is gone now Opera is acting weird. What I’d like to do is put a little snippet of php at the top of the page that looks for the browser type and if it’s Opera, echo the doctype. Otherwise leave the doctype off.

Is that possible?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 14.2009 — There's probably no dependable way, as you would have to check the $_SERVER['HTTP_USER_AGENT'] setting which is notoriously undependable.

A much better solution would be to find out why a doctype declaration, which is a standard, required part of any [X]HTML document, is screwing up your application.
×

Success!

Help @jessnoonyes 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.19,
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,
)...