login | register
Sun 14 of Mar, 2010 (14:05 UTC)

bitweaver - Web Application Framework and CMS

Web Application Framework and CMS

Refresh cacheRSS feedPrint

In Smarty, how do I check what browser is being used?

by Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Here is a code sample for your .tpl:

{if $gBitLoc.browser.client eq 'mz' or $gBitLoc.browser.client eq 'ie'}
    This browser is IE or Mozilla based!
{/if}


the end.

Comments

Reply to this comment

Browser name & version

by Vernard Mercader, Tue 17 of Nov, 2009 (21:33 UTC)
...How about the browser version?
Reply to this comment

by Vernard Mercader, Wed 18 of Nov, 2009 (00:09 UTC)
Actually, the proper code is:

{if $gBrowserInfo.browser eq 'mz'}
            You are using Firefox
{/if}


;)