ukpapillon Posted March 1, 2007 Share Posted March 1, 2007 ??? Hi, I've tried everything to sort this php error message below appearing on my website: Warning: chk_language(language/.php) [function.chk-language]: failed to open stream: No such file or directory in /home/mysite/public_html/include/function.php on line 35 Warning: chk_language(language/.php) [function.chk-language]: failed to open stream: No such file or directory in /home/mysite/public_html/include/function.php on line 35 Warning: chk_language() [function.include]: Failed opening 'language/.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/include/function.php on line 35 I've re-installed the script, checked permissions, checked php code and there's no errors on database. I don't understand, everything seems ok. Its been days since I've tried to sort this problem out.... :'( Please, can anyone help me here? Quote Link to comment Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 Can you show us some code...? Orio. Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2007 Share Posted March 1, 2007 Is this a third party script? It may just be a bug. Would suggest contacting support or whomever created it. Other than that, we'd need to see where the chk_language() function is both defined and called. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 Hi, This is the function.php code and the problem seems to be on line 35 <?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"); } } //CHECK HOTORNOT MEMBER LOGIN function chk_member_login($viewkey="") { global $config,$conn; $sql="select * from signup where UID=$_SESSION[uID]"; $rs=$conn->execute($sql); if($_SESSION['UID']=="" || $_SESSION['EMAIL']=="" || $rs->recordcount()==0) { $q = ""; while(list($k,$v)=each($_GET)){$q.="&$k=$v";} $q=base64_encode($q); if($q!="")$add="&add=$q"; $temp=$_SERVER['PHP_SELF']; $path=explode("/",$temp); $page=$path[count($path)-1]; $page=str_replace(".php","",$page); header("Location:$config[baseurl]/signup.php?next=$page$add"); exit; } } Quote Link to comment Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 The problem is here: $sql="select * from sconfig where soption='language'"; $rs=$conn->execute($sql); $default=$rs->fields[svalue]; Make sure everything is ok over there. Orio. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 Hi, I did contacted the support , I am still waiting for their replies since. I'm trying to find help somewhere else in meantime. There's no bug, I've checked. Is something to do with the default language setting. Must be an error somewhere in the php code. Quote Link to comment Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 Are you sure you have set a default language? Orio. Quote Link to comment Share on other sites More sharing options...
itsmeArry Posted March 1, 2007 Share Posted March 1, 2007 that seems the problem because the $default dosenot hold any value so it cannot open a file language/.php Quote Link to comment Share on other sites More sharing options...
SNN Posted March 1, 2007 Share Posted March 1, 2007 To me it seems what I think it is, $default.php is not in the correct directory or is not even in the folder(s). I suggest you make sure the settings for $default.php is correct and that the file is in place. EDIT: Ah. itsmeArry got it correct, that should work (Look up! lol) Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2007 Share Posted March 1, 2007 There's no bug, I've checked. Well from the small snippet you've posted its pretty poorly coded so it wouldn't supprise me. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 Hi Orio Thank you so much for helping me. You think its a database error? Quote Link to comment Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 My question is- are you sure you've configured everything correctly, specifically the default language setting? Orio. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 I didn't created the snippet, I bought the whole script and cost me quite alot. I'm not reaaly an expert on php code. I will contact again my support to let them know the snippet is poorly coded. I'm so confused. Thank you ever so much to all trying to help me here. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 Sorry about my poor spelling Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted March 1, 2007 Author Share Posted March 1, 2007 How do I configure the default language setting? I believe this is the problem. There's only 2 languages to select from my homepage : English and Japenese. When the error message appear on my homepage, if I select Japenese, everything goes normal and the message don't show anymore. Strange ..... I'm using a VPS server and can access to all files. This is for a video share website. Its quite a big program. All I need is your guidance on how to config. the default language Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2007 Share Posted March 1, 2007 You would need to read the installation instructions that came with the program. We have no way of knowing how this app is setup. Quote Link to comment Share on other sites More sharing options...
itsmeArry Posted March 1, 2007 Share Posted March 1, 2007 make sure that you have some value for default language in "sconfig" table and also have a look at the field of default language in the table is it "svalue" if not then cnange the code here $sql="select * from sconfig where soption='language'"; $rs=$conn->execute($sql); $default=$rs->fields[svalue to $sql="select * from sconfig where soption='language'"; $rs=$conn->execute($sql); $default=$rs->fields["[b]field name in table sconfig for default language[/b]"]; change what I have highlighted. you didn't get the error once you chose Japneese bcz.. it set in session $_SESSION['lang']; Quote Link to comment Share on other sites More sharing options...
Orio Posted March 1, 2007 Share Posted March 1, 2007 Basically, you need to run this query to set english your default language: "INSERT INTO `sconfig`(soption, svalue) VALUES ('language', 'en_US')" If you have phpMyAdmin you can do it through that, if you don't, you'll have to run it through a php file. Orio. Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted March 1, 2007 Share Posted March 1, 2007 so far i encounter most of the script default langauge is set to english so that unedrstable by everyone... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.