ukpapillon Posted February 23, 2007 Share Posted February 23, 2007 Hi, My homepage shows the error messages below: 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 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 Presently, there's two languages options to choose from, (english/japenese)English is the default. Strangely when I select japenese, my homepage goes back to normal with all the features working perfectly. I've tried everything. Restore the files, repair..etc.. I cannot find the source of the problem and this is driving me insane ??? I am using VPS hosting. Please can someone help me here Maria Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 23, 2007 Share Posted February 23, 2007 We'd have to see the code, but the error is obvious. language/.php is not a valid file. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted February 23, 2007 Author Share Posted February 23, 2007 Below is the language.php script: <?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"); } } This is where there's a problem. Line 35 ??? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 23, 2007 Share Posted February 23, 2007 first of all $_SESSION[lang] needs to be $_SESSION['lang'] - any string as a key in an array needs quotes atround it. Same for $rs->fields[svalue]; do print_r($rs->fields) right after that and what do you get? Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted February 24, 2007 Author Share Posted February 24, 2007 Hi Jesirose Thank you so much for helping me. Sorry I took long to reply. Had to go out. Below is the rest of the script. Its quit a long code ( cannot insert the whole code): //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; } } function session_to_db() { global $conn; $sql="select * from signup where UID=$_SESSION[uID]"; $rs=$conn->execute($sql); if($rs->recordcount()>0) { $_SESSION[emailVERIFIED]=$rs->fields['emailverified']; } } //MAIL FUNCTIION function mailing($to,$name,$from,$subj,$body,$bcc="") { global $SERVER_NAME; $subj=nl2br($subj); $body=nl2br($body); $recipient = $to; if($bcc!="") $headers = "Bcc: " . $bcc."\n"; $headers .= "From: " . $from . "\n"; //$headers .= "X-Sender: <" . "$to" . ">\n"; //$headers .= "Return-Path: <" . "$to" . ">\n"; //$headers .= "Error-To: <" . "$to" . ">\n"; $headers .= "Content-Type: text/html\n"; mail("$recipient","$subj","$body","$headers","-f$from"); } //EMAIL VERIFICATION function isMailVerified() { global $config; if($_SESSION[emailVERIFIED]=="no") { header("Location:$config[baseurl]/confirm_email.php"); } else if ( $_SESSION['EMAILVERIFIED']=="off" ) { header("Location:$config[baseurl]/confirm_email.php?flag=off"); } } function is_commented($vid) { global $config,$conn; $sql="select count(*) as cnt from comments WHERE VID=$vid and UID=$_SESSION[uID]"; $rs=$conn->execute($sql); if($rs->fields[cnt]>0) return "yes"; } function is_video_commented($vid) { global $config,$conn; $sql="select be_comment from video WHERE VID=$vid"; $rs=$conn->execute($sql); return $rs->fields[be_comment]; } function is_video_rated($vid) { global $config,$conn; $sql="select be_rated from video WHERE VID=$vid"; $rs=$conn->execute($sql); return $rs->fields[be_rated]; } function is_video_embabed($vid) { global $config,$conn; $sql="select embed from video WHERE VID=$vid"; $rs=$conn->execute($sql); return $rs->fields[embed]; } } ?> Quote Link to comment Share on other sites More sharing options...
alecks Posted February 24, 2007 Share Posted February 24, 2007 Have you checked to see if the permissions are set correctly? see if languages/en_US.php has the same permissions as ja.php Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 24, 2007 Share Posted February 24, 2007 You didn't actually answer my question - and in the future when you post code use the code tags. Quote Link to comment Share on other sites More sharing options...
ukpapillon Posted February 25, 2007 Author Share Posted February 25, 2007 Sorry for not answering to your question sooner. My computer crashed for the last few days. I checked also the permissions and they are the same. 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.