Forum Moderators: martinibuster

Message Too Old, No Replies

Conditional Code for Referral Links

How can I only show Firefox Referral Button to none-FF users

         

Blue_Chi

5:09 am on Apr 3, 2007 (gmt 0)

10+ Year Member



I'd like to display the FF referral link to visitors using any browser other than FF and show something else to FF users, I am sure that this is possible to achieve using some simple conditional script, but I do not know how to actually do it. It would be great if anybody could help

garyr_h

6:22 am on Apr 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For something like this you will have to use a scripting language. It is possible to just use html to show it only for IE visitors, but I don't think that is what you want?

For PHP, you could just check the browser:


if (!strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')) {
echo "FF Referral button";
}