Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-02-2007, 11:39 AM   PM User | #1
ukpapillon
New to the CF scene

 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ukpapillon is an unknown quantity at this point
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
ukpapillon is offline   Reply With Quote
Old 03-02-2007, 03:46 PM   PM User | #2
ess
Regular Coder

 
Join Date: Oct 2006
Location: United Kingdom
Posts: 865
Thanks: 7
Thanked 29 Times in 28 Posts
ess will become famous soon enough
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
ess is offline   Reply With Quote
Old 03-02-2007, 06:48 PM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:51 PM.


Advertisement
Log in to turn off these ads.