Wednesday, 15 August 2012

php - Activate <div> based on User Agent -


I need to activate "div" depending on the user agent string. For example, (and this is my real use), a user with Firefox comes to my site. I want to say something on the "Welcome to Firefox User!" Thank you for supporting Open Source Software;

This message is inside a single device. I will only show it to Firefox users. It should be compatible with most modern (mainstream) browsers. I am using PHP.

In advance thanks

Artur

Server with PHP -Side, you can observe the user's browser with the built-in $ string _SERVER ['HTTP_USER_AGENT'] followed by the string, depending on its value, you can output a DIV.


No comments:

Post a Comment