Forum Moderators: coopster
I need someone to help me with this error message showing on my homepage and I've tried to sort this out for days :(
Error message:
Warning: chk_language() [function.include]: Failed opening 'language/.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/videomy/public_html/include/function.php on line 35
The funtion.php code:
<?php
//CHECK HOTORNOT ADMINISTRATOR LOGIN
function chk_admin_login()
{
global $config;
if($_SESSION['AUID']!=$config[admin_name] ¦¦ $_SESSION['APASSWORD']!=$config[admin_pass])
{
header("Location:$config[baseurl]/siteadmin/login.php");
exit;
}
}
//CHECK LANGUAGE SELECTED
function chk_language()
{
global $conn;
if ($_SESSION[lang] == 'english')
{
include("language/en_US.php");
}
elseif($_SESSION[lang] == 'japanese')
{
include("language/ja.php");
}
else
{
$sql="select * from sconfig where soption='language'";
$rs=$conn->execute($sql);
$default=$rs->fields[svalue];
include("language/$default.php");
}
}
I've checked all the language.php files and everything seems ok. I don't know what to do resolve this problem.
I am guessing your default is not being set here
include("language/$default.php");
if you look at the error message it is trying to include language/.php
language directory with no filename, just the .php extension
the only line I could see where you were using a var for the filename was the one I mentioned so I am guessing it is at that line