By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

Php Error message on my homepage. Please help me

P: 3
Hi,

I keep on getting an error message on my homepage. The header and footer disapear. Strangely if I select japenese on the language box on my homepage, everything goes to normal? Cannot find the source of the problem.
Error message below:

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

Im using VPS hosting for video share website. I don't understand what is the problem. Something to do with the language function.
Php function code below:
[php]
<?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");
}
}[/php]

Can someone help me here

Read the Posting Guidelines sta the top of this forum before you post anyting. Especially the part about enclosing shown code within php or code tags!!

moderator
Feb 21 '07 #1
Share this Question
Share on Google+
2 Replies


ronverdonk
Expert 2.5K+
P: 4,258
You most probably have not set the variable $default, because the error is returned on that statement

[php]include("language/$default.php");[/php]

Ronald :cool:
Feb 21 '07 #2

P: 3
Thank you ever so much Ronverdonk. I will try to sort this out
Feb 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.