Quote:
Originally Posted by Oracle Porn
this works, but how do I show nothing for some countries?
|
No problem, try this one:
PHP Code:
<?php
$banner['default'] = '<img src="default-banner.jpg" alt=""/>';
$banner['AU'] = '<img src="au-banner.jpg" alt=""/>';
$banner['DE'] = '<img src="de-banner.jpg" alt=""/>';
$banner['US'] = '<img src="us-banner.jpg" alt=""/>';
$country_code = getenv(GEOIP_COUNTRY_CODE);
echo (isset($banner[$country_code]))
? $banner[$country_code] : $banner['default'];
?>
And if you wanna to show "nothing" for specified country just add:
PHP Code:
$banner['BE'] = '';