poterasal Posted October 1, 2013 Report Posted October 1, 2013 Salut am o problema , am un script si primesc urmatoarea eroare:PHP Warning: Creating default object from empty value in /home/public_html/app/classes/language.php on line 35Linia 35 din language.php: $session->LANGUAGE = $DEFAULT_LANGUAGE;Stie cineva cum pot rezolva aceasta eroare? Quote
sadik Posted October 1, 2013 Report Posted October 1, 2013 Ai vreo valoare salvata in $DEFAULT_LANGUAGE? Quote
poterasal Posted October 1, 2013 Author Report Posted October 1, 2013 Nu am nici o valoare , mai jos am pus fisierul language.php cu tot ce se afla in el , da-i un ochi aici :<?php class Language { /* Check if the language exists in the file directory and return booleans true if exists if not false */ public function checkLanguage($lang) { global $LANGUAGE_DIR; $language = $LANGUAGE_DIR . "/" . $lang . ".lang"; if (file_exists($language)) { return true; } else { return false; } } /* Set Language */ public function setLanguage($language) { global $DEFAULT_LANGUAGE; global $LANGUAGE_DIR; if ($language) { $session->LANGUAGE = $language; } if (!isset($session->LANGUAGE)) { $session->LANGUAGE = $DEFAULT_LANGUAGE; } if ($this->checkLanguage($session->LANGUAGE)) { $lang = $session->LANGUAGE; return $lang; } else { return $DEFAULT_LANGUAGE; } } /* Get Languages */ public function getLanguage($language) { global $LANGUAGE_DIR; $lang = $this->setLanguage($language); include_once($LANGUAGE_DIR . "/" . $lang . ".lang"); return $lang; } }?> Quote