Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z wieloma językami, pomoc
Hpsi
post
Post #1





Grupa: Zarejestrowani
Postów: 483
Pomógł: 50
Dołączył: 15.03.2005
Skąd: Poznań

Ostrzeżenie: (0%)
-----


Witam mam problemik pewien, pobieram przez ten kodzik informacje o języku uzytkonika
  1. <?php
  2.  
  3.     class lng
  4.     {
  5.         function lng()
  6.         {
  7.             $this->lng = &$GLOBALS['table']['lng'];
  8.         }    
  9.             function check()
  10.             {    
  11.                 if($_SESSION['lng'] == '')
  12.                 {
  13.                     $lng = preg_replace('{;.*}', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
  14.                     if($lng == '')
  15.                     {
  16.                         $lng = 'en';    
  17.                     }
  18.                     $result = mysql_query(&#092;"SELECT * FROM {$this->lng} WHERE lng='{$lng}'\");
  19.                 
  20.                     if($result = mysql_num_rows($result) == 0)
  21.                     {
  22.                         $_SESSION['lng'] = 'en';    
  23.                     }
  24.                     else 
  25.                     {
  26.                         $lng = preg_replace('{;.*}', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
  27.                         $_SESSION['lng'] = $lng;    
  28.                     }
  29.                     
  30.                 }
  31.                                 
  32.             }
  33. }
  34.  
  35.  
  36. ?>

Jednak jak włączam strone to pokazuje mi się następujący error
Kod
Warning: index(lang//index.lng.php): failed to open stream: No such file or directory in  class/ret.cl.php on line 17

Warning: index(lang//index.lng.php): failed to open stream: No such file or directory in  class/ret.cl.php on line 17

Warning: index(): Failed opening 'lang//index.lng.php' for inclusion (include_path='.:/usr/local/lib/php') in  class/ret.cl.php on line 17

Czyli wychodzi ze nie ma zmiennej $_SESSION['lng'] bądź jest pusta... dlaczego to może się tak dziać ?

Co lepsze ... po odświezeniu strony ... wszystko działa bez problemów.
Sprawdzałem to na: Ie, Nestspace, FireFox, i Operze .... na każdym to samo

Ten post edytował Hpsi+ 26.04.2005, 23:44:30
Go to the top of the page
+Quote Post

Posty w temacie
- Hpsi+   Problem z wieloma językami   26.04.2005, 23:41:53


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 22:39