Connecting Tech Pros Worldwide Help | Site Map

Php Error message on my homepage. Please help me

Newbie
 
Join Date: Feb 2007
Posts: 3
#1: Feb 21 '07
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
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Feb 21 '07

re: Php Error message on my homepage. Please help me


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:
Newbie
 
Join Date: Feb 2007
Posts: 3
#3: Feb 26 '07

re: Php Error message on my homepage. Please help me


Thank you ever so much Ronverdonk. I will try to sort this out
Reply


Similar PHP bytes