Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Php error message showing on my homepage. Help me

    Hi,

    I'm having a very frustrating time with an error message showing on my homepage: http://www.videomyst.com

    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


    Snippet for language funtion:
    <?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;
    }
    }

    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");
    }

    Cannot insert the rest, is too long

    To be honest I don't know nothing about php functions and I need someone to guide me through on how to sort out this default language.php problem have been having for days

    I'm using VPS server and I have full access files and database.

    Please help me
    Last edited by ukpapillon; 03-02-2007 at 11:42 AM. Reason: Forgot to insert the code

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    This only a guess.

    At the beginning of your function chk_admin_login, you have the following line.
    Code:
    global $config;
    But where did you define $config??? is it defined in a separate file? if that is the case, you must include that file so that your function will be able to make use of the array etc.

    Hope that helps.

    Cheers,
    Ess

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Quote Originally Posted by ukpapillon View Post
    else
    {
    $sql="select * from sconfig where soption='language'";
    $rs=$conn->execute($sql);
    $default=$rs->fields[svalue];
    include("language/$default.php");
    }
    $default is not being set by the script; Either your query is failing or the code to execute it is wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •