Fatal Error Using $this when not in object context in

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
svankamon
-


Joined: 01 Apr 2007
Posts: 148
Location: Chesterfield UK

PostPosted: Tue Jun 26, 2007 11:33 am    Post subject: Fatal Error Using $this when not in object context in Reply with quote

Hi all. THanks for the help thus far. I wouldnt have done it without ya. This is an error i believe to be compatability with V5 PHP. From my gatherings i need to install V4 to get this to work. Although some posts i read seemd top solve the questions other had. However, having said that. Again. I havent a clue.
This is the full error:

Fatal error: Using $this when not in object context in L:\mydomain\rest1red\include\common.php on line 11

The common line its talkin about is this:

$att_path = "uploads/";
$paypal_item_number = $sitename;
$mainipn = $siteurl."/ipn.php";
$paypal_ipn = $siteurl."/site_ipn.php";
$paypal_cancel_return = $siteurl."/cancel.php";
$paypal_return = $siteurl."/thanks.php";
$this->min_pass_length=8;
$this->max_pass_length=12;
$this->chars='abcdefghijklmnopqrstuvwxyz0123456789';
$logfile = "logfile.txt";
$postmode = 1;

Again i say it (and its gonna be my catchphrase) I Havent A Clue.

I understand this isnt a AWS problem. Abyss doesnt have any problems. Its far superior to others ive tried and ive tried am all. Got it up and running and its worked ever sincvce thanks to the guys at aprelium and the forum chaps. Thanks again.

Id apreciate any opinions thanks.
Back to top View user's profile Send private message Send e-mail
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue Jun 26, 2007 12:42 pm    Post subject: Reply with quote

I think if I remember correctly $this is a reserved word in PHP and cannot be used. I had a script using the same variable name and it wouldn't work until I changed it.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
svankamon
-


Joined: 01 Apr 2007
Posts: 148
Location: Chesterfield UK

PostPosted: Tue Jun 26, 2007 2:34 pm    Post subject: Reply with quote

Do you have an idea what to change it too.?

I visited a link after doing a search for the problem and this other chap was told to change it to:

if(!isset($this)) {

He tried it and it worked. I tried it and it didnt. Must be the context he was using it.

The guy went on to say:

$this can only be used inside an object.
It's a reference to itself, as you could guess.

From outside the object, you must use the instance name of the object.

I dont know what that means.
Any idea?

Cheers anyway. Steve.
Back to top View user's profile Send private message Send e-mail
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue Jun 26, 2007 2:36 pm    Post subject: Reply with quote

Just change $this to any other word. Eg. $that :-) Use the replace function to bulk replace it.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
svankamon
-


Joined: 01 Apr 2007
Posts: 148
Location: Chesterfield UK

PostPosted: Tue Jun 26, 2007 4:31 pm    Post subject: Sorted it Reply with quote

rather you sorted it. I replaced $this with $that, then it moved to problem on line 12, i did the same replacement, then it did it on line 13, replaced that $this with $that and it worked.

Whew, that was lucky cos i didnt have a clue about the bul replace thing.

Cheers.
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group