<?php
$files = scandir('../flags');
if(in_array(str_replace(' ','-',strtolower(str_replace('Cote D','Cote D Ivoire',$_GET['country']))).'.png',$files)) {
header('cache-control: public, max-age=31536000');
header('location: '.str_replace(' ','-',strtolower(str_replace('Cote D','Cote D Ivoire',$_GET['country']))).'.png');
}
else {
header('location: redirecting-error.png?'.$_GET['country']);
}
?>