Jump to content
php.lv forumi

cookie sakaraa


sandrulis

Recommended Posts

Apmēram šitā:

<?php
ob_start();
if(array_key_exists('valoda',$_COOKIE)){
  switch($_COOKIE['valoda']){
  case 'EN': $valoda='EN'; break;
  case 'GR': $valoda='GR'; break;
  default: $valoda='LV';
  }
}
else {
  setcookie('valoda','LV');
  $valoda='LV';
}
if(array_key_exists('valoda',$_GET)){
  switch($_GET['valoda']){
  case 'EN': $valoda='EN'; break;
  case 'GR': $valoda='GR'; break;
  default: $valoda='LV';
  }
  setcookie('valoda',$valoda);
  }
}
ob_flush();
?>

Link to comment
Share on other sites

×
×
  • Create New...