Skip to main content
Inspiring
November 22, 2006
Answered

Multiple browser sniffing

  • November 22, 2006
  • 1 reply
  • 258 views
I wrote a script for browser sniffing, but I need to modify it so IE and Opera see the same thing. Can someone tell me if I am writting this correctly?

<cfif #CGI.HTTP_USER_AGENT# CONTAINS "MSIE *.*","Opera *.*">
<b>they see this code</b>
<cfelse>
<b>they see this code</b>
</cfif>

is this correct for these 2 browsers to see the same thing?
Thank you

    This topic has been closed for replies.
    Correct answer
    Hi,
    No. Sorry.

    This would work a lot better:
    <cfif (#CGI.HTTP_USER_AGENT# CONTAINS "MSIE") OR (#CGI.HTTP_USER_AGENT# CONTAINS "Opera")>

    AM

    1 reply

    Correct answer
    November 24, 2006
    Hi,
    No. Sorry.

    This would work a lot better:
    <cfif (#CGI.HTTP_USER_AGENT# CONTAINS "MSIE") OR (#CGI.HTTP_USER_AGENT# CONTAINS "Opera")>

    AM