[thelist] if this then this in php

Adam adam at hallinteractive.com
Mon Jan 6 12:47:00 CST 2003


> You can't use SSI and PHP in the same file.  Sorry.
>
> A better way to do it would be just figure out what browser it is using
> PHP *instead of* SSI.  I believe that PHP's $_SERVER['HTTP_USER_AGENT']
> is the same thing as SSI's $HTTP_USER_AGENT, so try using it instead (in
> your PHP script).

Hihi thx for the replies.

Yes I realized the SSI's don't function in php docs. What I'm trying to do
is this:
inline(not in an external php doc) sniff for winIE5.0(not 5.5) and give
WinIE5.0 a different <div id="#"> than everything else.

My php is pure n00b and my usual source is unavailable.

How would this be written in PHP and not SSI?

>> <!--#if expr="$HTTP_USER_AGENT = /MSIE [45]/" -->
>> <div id="WINIE5.0">
>>   <!--#elif expr="$HTTP_USER_AGENT = /Mozilla\/[56]/" -->
>> <div id="EVERYTHINGELSE">
>>   <!--#else -->
>> <div id="EVERYTHINGELSE">
>>   <!--#endif -->

also sasha:
MSIE 5.[0-4]{1}[0-9]*
Will this be 5.0 only and not 5.5?

thanks again for any help.

Adam Leon
Pupilchoke Design
http://www.pupilchoke.com
http://www.tonguesnthumbs.net






More information about the thelist mailing list