Php Tarayıcı Diline Göre Yönlendirme, Php Ülke Engelleme

Aşağıdaki php kodunun eklendiği sayfaya Türkçe tarayıcıdan erişilmeye çalışılır ise hata verir ve tr.php dosyasına yönlendirir.


$dil = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2);
 
  if ($dil == 'tr') {
    header("Location: tr.php");
  }

Bu cevap yeterince yardımcı oldu mu?

Daha Fazlası

Uploads dizini oluşturulamıyor. Bir üst dizin sunucu tarafından yazılabilir mi?

wp-content/uploads/X dizini oluşturulamıyor. Bir üst dizin sunucu tarafından yazılabilir mi...

PhP Timezone Hatası Çözümü - date() It is not safe to rely on the system's timezone settings

date() It is not safe to rely on the system's timezone settings hatasının çözümü aşağıdaki...

Opencart startup.php on line 89 Hatası Çözümü

İlgili hata opencart ın open_basedir yapısı ile sorun yaşamasından yani dizin yolunu...

Sorry, this file type is not permitted for security reasons Çözümü

Wordpress scriptinizde dosya yüklerken Satır x Sorry, this file type is not permitted for...

Wordpress open_basedir restriction in effect Hatası Çözümü

Warning file_exists() open_basedir restriction in effect hatasını aşağıdaki şekilde çözerek...