if(!preg_match('#^http://.*([^/]+\.('.ALLOWED_FILENAMES.'))$#', $_POST['resim'], $m)) { die('Desteklenmeyen Uzantı!'); }