Show If is an online tool that will help you generate PHP code to easily target your visitors based on their browser, operating system, referrer, screen resolution, language and location.

Most of the targeting options are found from the browser’s header information. You can use this online tool to generate code that can let you show ads to certain users, customize your landing page, ban certain users, geo-targeting, etc.
You can put a keyword instead of a domain name in the referrer section. The referrer section searches the entire referring URL string for the word you enter, not just the domain name. If you want to target people who searched for the keyword “Free” you could just put that keyword in the referrer section.
The geo-targetting option runs off of the project at hostip.info, and allow_url_fopen must be turned on in PHP configuration (php.ini) for generated code to work. Visit Show If: http://showif.com/




Users should be careful not to abuse this kind of user agent / ip / referrer based content delivery, or they may fall foul of Bait-and-Switch search engine bans.
Make sure that you’re not serving drastically different content to each user agent, or you could run into trouble!