Jump to content

Still getting php error message on my homepage. Tried everything....


ukpapillon

Recommended Posts

??? 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?  :(

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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;

       }

}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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'];

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.