473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Fatal error: Call to a member function on a non-object. Pls help.

Hi,
I am not very good at PHP and am trying to install a script but I have this problem that I just can't figure out...

Code snippet:

<?php
// UTF-8 helper functions
require(dirname(__FILE__) .'/includes/utf8.php');

include('Mail.php');

// Translation
require(dirname(__FILE__) .'/includes/php-gettext/streams.php');
require(dirname(__FILE__) .'/includes/php-gettext/gettext.php');
$input = new FileReader(dirname(__FILE__) .'/locales/'. $locale .'.mo');
$l10n = new gettext_reader($input);

// Standard wrappers for xgettext
function T_($text) {
global $l10n;
return $l10n->translate($text);
}

function T_ngettext($single, $plural, $number) {
global $l10n;
return $l10n->ngettext($single, $plural, $number);
}


PHP throws 'Fatal error: Call to a member function on a non-object ..
functions.inc.php on line 16' at me whenever I request this page.
Code at line 16: return $l10n->translate($text);

What am I doing wrong?

Thanks!
Oct 19 '06 #1
2 2435
Any help? Please?
Oct 21 '06 #2
ronverdonk
4,258 Expert 4TB
I really have no idea, but at least you can trace some things.You can issue [php]echo $I10n.'<br>';[/php] statements right after the $l10n = new gettext ... stmt, and inside the function. At least you can see if both echoes return an object reference and have the same Object #xxx text content. If not, you must look further.

Ronald :cool:
Oct 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: PeterF | last post by:
Hello, what is wrong here? the purpose is to create an array of objects and then interate over it, calling some method from all of them. I get just the following at the marked line ("// FATAL...
4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
8
by: Tim Tyler | last post by:
I'm getting fatal errors when executing code - and my error handler is failing to trap them - so I get no stack backtrace :-( The error I am getting is: "Fatal error: Call to a member function...
2
by: dmitry.freitor | last post by:
Why would someone call a non-static provate member function from another non-static member function of the same class via the this pointer? Thanks. DF
7
by: Ook | last post by:
What am I doing wrong? This code gives a compile error: 'SortedList<T>::insert' : illegal call of non-static member function. I've tried several variations of this, but keep getting the same error....
4
by: Jesper Stocholm | last post by:
I have a recursive function that I would like to do a lot of recursive calls (preferebly 2^20 in total) The function is called as (with maxi = e.g. 100000) DoRecursion(0,maxi,bseed,sha); ...
6
by: Bill Rubin | last post by:
The following code snippet shows that VC++ 7.1 correctly compiles a static member function invocation from an Unrelated class, since this static member function is public. I expected to compile the...
8
by: nsharma78 | last post by:
Hi, I have a code as follows: class A { public: void print(){cout << "Magic" << endl;} };
1
by: Simon Kittle | last post by:
Hi, Is it possible in PHP to provide a nice pretty page when a fatal error occurs? (Or any of the errors listed here http://uk.php.net/manual/en/function.set-error-handler.php which you cannot...
4
by: nickyspace | last post by:
HI all I have a little issue with this php code. Below is the code CODE: PHP 1.<?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.