SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP Smarty - {if} Browser Detection {else}

    Hey guys,
    I'd just like to know if theres a smarty code that can detect the users browser that can then show a different template?

    Like if your using IE, it will detect the browser and add a top menu saying download Mozilla Firefox.

    Hope there is such thing, thanks.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Use IE conditional comments - see http://msdn.microsoft.com/en-us/libr...12(VS.85).aspx

    IE is the only browser that has such a thing as those conditionals are specific to Microsoft software (meaning you can only test for such things as IE (Internet Explorer) and MSO (Microsoft Office).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •