SSI browser detection...

They have: 5 posts

Joined: Mar 2001

Wonder if anyone here can help me with this, as the Apache documentation hasn't. Before I plough ahead with the programming I wondered if anyone knows how you can detect the browser using SSI?

What I want to do is print an appropriate line (to be exact, a stylesheet tag) to the page depending on their browser. Would I do an exec command and run some kind of script?

Sorry for being a bit vague but I'm new to SSI.

Thanks in advance for any suggestions.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Look for http- as a key word at apache, or try the tuts on ssi at http://www.bignosedbird.com.

In a nutshell, yes, you can use SSI to read the browser, but a word of caution -- you will likely need to explore some scripting methods for SSI, like those found at http://www.webdesignclinic.com/ezine/v1i1/ssi/index.html

Sorry I can't be more specific, I've never tried to do it with SSI, though I regularly read specs through email forms and of course in my site stats that use it.

Smiling Suzanne

He has: 688 posts

Joined: Feb 2001

Can a simple java script be used to determine which SSI code to use?

They have: 5 posts

Joined: Mar 2001

That's what I'm doing ATM - using JS to detect the browser and print a different

AndyB's picture

They have: 344 posts

Joined: Aug 1999

to detect a browser, then

http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html

even includes code to detect webTV and Opera (which can be set to masquerade as other browsers).

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.