Forum Moderators: open

Message Too Old, No Replies

SSI browser check

to include different files

         

jamie

3:07 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi all,

i would like to use SSI to check browser and deliver the appropriate include.txt

i would like to check for MSIE 5 and 6 and give the rest something else:

<!--#if expr="${HTTP_USER_AGENT} = /MSIE 6/" -->
<!--#include file="ie.txt" -->
<!--#if expr="${HTTP_USER_AGENT} = /MSIE 5/" -->
<!--#include file="ie.txt" -->
<!--#else -->
<!--#include file="nn.txt" -->
<!--#endif -->

except this doesn't work. i know it has something to do with my syntax duplicating the #if expression for MSIE 6 and MSIE 5.

would much appreciate some help :)

many thanks

brotherhood of LAN

3:10 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use else if, and for any browsers/versions where you want to display the same content I think the concatenate operator should work, the pipe ¦

That would work for PHP but I'm sure the syntax is v.similar for what you're using ;)

jamie

6:51 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

sorry, i don't understand.

i have tried

<!--#if expr="${HTTP_USER_AGENT} = /MSIE5 ¦ MSIE6/" -->
<!--#include file="ie.txt" -->
<!--#else -->
<!--#include file="nn.txt" -->
<!--#endif -->

but it doesn't work, it only recognises MSIE5.

..puzzled...

i only copied this out from somewhere else, i didn't write it myself :)

jatar_k

6:54 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



<!--#if expr="${HTTP_USER_AGENT} = /MSIE 6/" -->
<!--#include file="ie.txt" -->
<!--#elseif expr="${HTTP_USER_AGENT} = /MSIE 5/" -->
<!--#include file="ie.txt" -->
<!--#else -->
<!--#include file="nn.txt" -->
<!--#endif -->

that's what BOL means

jamie

1:34 pm on Nov 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi jatar k and BOL,

i have copied that out word for word, but doesn't work in my IE5.5 browser. i get the nn.txt.

i can only get it to work by using the /MSIE/ generic term. which in itself is not so bad, as even IE4 understands the ie.txt that i want to insert.

many thanks for your help anyway, i think i'm just being a dunce :)