View Single Post
Old 12-30-2013, 10:03 AM  
Oracle Porn
Affiliate
 
Oracle Porn's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Icq: 94-399-723
Posts: 24,433
Quote:
Originally Posted by KlenTelaris View Post
That is correct my e-penis is hugeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.
PHP Code:
if ($country_code==DE){ echo '<img src="Debanner.jpg"></img>';}
else
{echo 
'<img src="allbanner.jpg"></img>';} 
Better way:
PHP Code:
 <?php

    $country 
getenv(GEOIP_COUNTRY_NAME);
    
$country_code getenv(GEOIP_COUNTRY_CODE);


switch (
$country_code) {
        case 
'US':
        echo 
'<img src="Usbanner.jpg"></img>';
            
        case 
'DE':
        echo 
'<img src="Debanner.jpg"></img>';
        
        default:
         echo 
'<img src="Other.jpg"></img>';
            
            
    }
?>
this doesn't seem to work for me....

Quote:
Originally Posted by Constantine View Post
Another graceful way to do the same:

PHP Code:
<?php

    $banner
['default'] = 'default-banner.jpg';

    
$banner['AU'] = 'au-banner.jpg';
    
$banner['DE'] = 'de-banner.jpg';
    
$banner['US'] = 'us-banner.jpg';


    
$country_code getenv(GEOIP_COUNTRY_CODE);

    if (isset(
$banner[$country_code]))
    {
        
$banner['default'] = $banner[$country_code];
    }

    echo (
'<img src="' $banner['default'] . '" alt=""/>');
?>

this works, but how do I show nothing for some countries?
__________________


Oracle Porn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote