Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Wielojezycznosc strony
zabolek
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 21.05.2010

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


witam mam problem mam kod


  1. if(!isset($_SESSION['lang']) && trim($_GET['lang']) == '') {
  2. $_SESSION['lang'] = 'polish';
  3. include('language/polish/index.php');
  4. } else {
  5. $_SESSION['lang'] = $_GET['lang'];
  6. include('language/'.$_SESSION['lang'].'/index.php');
  7. }


i po odswiezeniu strony jak sie pokaze lang to wywala mi to


  1. Warning: include(language//index.php) [function.include]: failed to open stream: No such file or directory in include/functions.php on line 9
  2.  
  3. Warning: include() [function.include]: Failed opening 'language//index.php' for inclusion (include_path='.:/usr/local/lib/php') in include/functions.php on line 9



tak jak by nie mogl go zapamietac sad.gif
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
marcio
post
Post #2





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


Widocznie nie podajesz parametru lang w url i tyle
  1. if(!isset($_SESSION['lang']) && !isset($_GET['lang'])) {
  2. $_SESSION['lang'] = 'polish';
  3. include('language/'.$_SESSION['lang'].'/index.php');
  4. } else {
  5. $_SESSION['lang'] = $_GET['lang'];
  6. include('language/'.$_SESSION['lang'].'/index.php');
  7. }

Pokaz jak z jakim adresem url to wywolujesz....i upewnij sie ze istnieje katalog dla innych jezykow :]

P.S aha a sesji ci nie zapisuje bo chyba session_start() zapomniales dac snitch.gif

Ten post edytował marcio 26.05.2010, 08:39:43


--------------------
Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/
Moj blog
Go to the top of the page
+Quote Post
zend
post
Post #3





Grupa: Zarejestrowani
Postów: 580
Pomógł: 85
Dołączył: 25.03.2010
Skąd: Skrzyszów :)

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


  1. include('language/'. (isset($_SESSION['lang']) ? 'domyslny jezyk' : $_SESSION['lang'] ).'/index.php');
taka konstrukcja uwolni to od błędów i jeszcze zrób to co napisał przedmówca smile.gif

Ten post edytował zend 26.05.2010, 09:56:31
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 19.08.2025 - 08:58