MovieLib - Your movie database on web
#78
Hi again.

To help troubleshooting i changed the first part of index.php to look like this:

<?PHP
session_start();
header('Content-type: text/html; charset=utf-8');
require('config.php');
require('function.php');

if (file_exists('install.php') or !file_exists('db.php')) {
header('Location:install.php');
die();
}

// connect to database
connect($mysql_ml);

// get settings from db
$set = get_settings($mysql_ml, $mysql_tables);

echo 'Command: echo $_SESSION[\'language\'];, Output: ';
echo $_SESSION['language'];
echo chr(13),chr(10);

echo 'Command: echo $set[\'language\'];, Output: ';
echo $set['language'];
echo chr(13),chr(10);

echo 'Command: print_r($set);, Output: ';
print_R($set);
echo chr(13),chr(10);

echo 'Command: print_r($_SESSION);, Output: ';
print_R($_SESSION);
echo chr(13),chr(10);

require('lang/' . $set['language'] . '/lang.php');


Now. the output of this returns this:

Command: echo $_SESSION['language'];, Output: Array
Command: echo $set['language'];, Output: Array
Command: print_r($set);, Output: Array
(
[site_name] => MovieLib
[language] => Array
(
[bg] => Bulgarian
[cs] => Czech
[da] => Danish
[de] => German
[en] => English
[es] => Spanish
[fr] => French
[hu] => Hungarian
[it] => Italian
[nl] => Dutch
[no] => Norwegian
[pl] => Polish
[pt] => Portuguese
[ru] => Russian
)

[theme] => default
[per_page] => 50
[panel_top_limit] => 10
[panel_top_time] => 5
[panel_top] => 1
[watched_status] => 1
[panel_overall] => 1
[panel_genre] => 1
[panel_year] => 1
[panel_country] => 1
[panel_v_codec] => 1
[panel_a_codec] => 1
[panel_a_chan] => 1
[show_fanart] => 1
[show_trailer] => 1
[protect_site] => 0
[token] =>
)

Command: print_r($_SESSION);, Output: Array
(
[site_name] => MovieLib
[language] => Array
(
[bg] => Bulgarian
[cs] => Czech
[da] => Danish
[de] => German
[en] => English
[es] => Spanish
[fr] => French
[hu] => Hungarian
[it] => Italian
[nl] => Dutch
[no] => Norwegian
[pl] => Polish
[pt] => Portuguese
[ru] => Russian
)

[theme] => default
[per_page] => 50
[panel_top_limit] => 10
[panel_top_time] => 5
[panel_top] => 1
[watched_status] => 1
[panel_overall] => 1
[panel_genre] => 1
[panel_year] => 1
[panel_country] => 1
[panel_v_codec] => 1
[panel_a_codec] => 1
[panel_a_chan] => 1
[show_fanart] => 1
[show_trailer] => 1
[protect_site] => 0
[token] =>
)


Warning: require(lang/Array/lang.php): failed to open stream: No such file or directory in /volume1/web/movielib2/index.php on line 36

Fatal error: require(): Failed opening required 'lang/Array/lang.php' (include_path='.:/usr/syno/php/lib/php') in /volume1/web/movielib2/index.php on line 36

Oh, and here is the exact same thing on the version of your script where i renamed the field called 'language' to 'dlanguage' in the database and in the php files:


Command: echo $_SESSION['dlanguage'];, Output: en
Command: echo $set['dlanguage'];, Output: en
Command: print_r($set);, Output: Array
(
[site_name] => vores site
[dlanguage] => en
[theme] => default
[per_page] => 50
[panel_top_limit] => 10
[panel_top_time] => 5
[panel_top] => 1
[watched_status] => 1
[panel_overall] => 1
[panel_genre] => 1
[panel_year] => 1
[panel_country] => 1
[panel_v_codec] => 1
[panel_a_codec] => 1
[panel_a_chan] => 1
[show_fanart] => 1
[show_trailer] => 1
[protect_site] => 0
[token] =>
)

Command: print_r($_SESSION);, Output: Array
(
[site_name] => vores site
[dlanguage] => en
[theme] => default
[per_page] => 50
[panel_top_limit] => 10
[panel_top_time] => 5
[panel_top] => 1
[watched_status] => 1
[panel_overall] => 1
[panel_genre] => 1
[panel_year] => 1
[panel_country] => 1
[panel_v_codec] => 1
[panel_a_codec] => 1
[panel_a_chan] => 1
[show_fanart] => 1
[show_trailer] => 1
[protect_site] => 0
[token] =>
)

As you can see, everything comes out as its supposed to here.
Reply
 
Thread Rating:
  • 8 Vote(s) - 4.63 Average


Messages In This Thread
RE: MovieLib - Your movie database on web - by jannik1979 - 2014-01-18, 00:28
Last Post - by Jeffreywat - 2017-09-03, 14:02


Logout Mark Read Team Forum Stats Members Help
MovieLib - Your movie database on web4.638