Professional Web Applications Themes

<CFLOCATION> depending on browser type/version - Macromedia ColdFusion

Hey hey hey, I am in the process of finishing a new style sheet based site and need a way to have coldfusion pass my page the browser type and browser version to redirect users of non standard compliant / older browsers to another page. I have tried: <cfset browser = #cgi.http_user_agent#> <cfif findNoCase ("msie 6", #browser#) EQ 0 or findNoCase ("netscape/7", #browser#) EQ 0 or findNoCase ("Firefox", #browser#) EQ 0> <cfset redirect = "no"> <cfelse> <cfset redirect = "yes"> </cfif> But this does not work as I was expecting it to. Any ideas gang? Is there a better way ...

  1. #1

    Default <CFLOCATION> depending on browser type/version

    Hey hey hey,

    I am in the process of finishing a new style sheet based site and need a way
    to have coldfusion pass my page the browser type and browser version to
    redirect users of non standard compliant / older browsers to another page.

    I have tried:

    <cfset browser = #cgi.http_user_agent#>
    <cfif findNoCase ("msie 6", #browser#) EQ 0 or findNoCase ("netscape/7",
    #browser#) EQ 0 or findNoCase ("Firefox", #browser#) EQ 0>
    <cfset redirect = "no">
    <cfelse>
    <cfset redirect = "yes">
    </cfif>

    But this does not work as I was expecting it to.

    Any ideas gang? Is there a better way to do this?

    Many thanks,
    Paul

    Outside5.com Guest

  2. #2

    Default Re: <CFLOCATION> depending on browser type/version

    It looks like you have problems in your if statement. FindNoCase will return a
    TRUE value if the substring is found in the string. Your want to set redirect
    to no if any of these three conditions is true. Try this syntax:

    <CFIF FindNoCase("msie 6", browser) OR
    FindNoCase("netscape/7", browser) OR FindNoCase("Firefox", browser)>
    do not redirect
    <CFELSE>
    redirect
    </CFIF>

    -Paul

    dempster Guest

  3. #3

    Default Re: <CFLOCATION> depending on browser type/version

    <CFIF FindNoCase("msie 6", browser) OR
    FindNoCase("netscape/7", browser) OR FindNoCase("Firefox", browser)>
    do not redirect
    <CFELSE>
    redirect
    </CFIF>Many thanks dempster - like a charm
    Outside5.com Guest

Similar Threads

  1. Replies: 3
    Last Post: May 18th, 07:31 AM
  2. Please help : Know the browser type into ActionScript ?
    By Debug in forum Macromedia Flash
    Replies: 2
    Last Post: November 6th, 11:16 AM
  3. PDF file doesn't open in web browser for Version 5 but does open for version 6
    By Kellye_Sliger@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 1st, 04:05 PM
  4. Getting users Flash Version and Browser Settings
    By Bobby Smith in forum Macromedia Director Lingo
    Replies: 1
    Last Post: September 27th, 09:17 PM
  5. Content Type = EXCEL in browser
    By Chris Davoli in forum ASP.NET General
    Replies: 0
    Last Post: July 14th, 01:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139