Detecting Browser Types
Posted: Fri Aug 22, 2003 10:49 pm
I would like to put the following metas into the html of search results
For IE browser:
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
For Netscape browser:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
I know I can use the $HTTP_USER_AGENT to determine the browser but there are so many different user agents, is there any way to make sure it's just Netscape or IE? I assume I would use something like this:
<If $HTTP_USER_AGENT like "">
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<Else>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</if>
Is there any other way to do it? Would it be better to do this in Apache instead?
Thank you for any assistance.
Gerry
For IE browser:
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
For Netscape browser:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
I know I can use the $HTTP_USER_AGENT to determine the browser but there are so many different user agents, is there any way to make sure it's just Netscape or IE? I assume I would use something like this:
<If $HTTP_USER_AGENT like "">
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<Else>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</if>
Is there any other way to do it? Would it be better to do this in Apache instead?
Thank you for any assistance.
Gerry