View previous topic :: View next topic |
Author |
Message |
svankamon -
Joined: 01 Apr 2007 Posts: 148 Location: Chesterfield UK
|
Posted: Tue Jun 26, 2007 11:33 am Post subject: Fatal Error Using $this when not in object context in |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Jun 26, 2007 12:42 pm Post subject: |
|
|
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 |
|
 |
svankamon -
Joined: 01 Apr 2007 Posts: 148 Location: Chesterfield UK
|
Posted: Tue Jun 26, 2007 2:34 pm Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Jun 26, 2007 2:36 pm Post subject: |
|
|
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 |
|
 |
svankamon -
Joined: 01 Apr 2007 Posts: 148 Location: Chesterfield UK
|
Posted: Tue Jun 26, 2007 4:31 pm Post subject: Sorted it |
|
|
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 |
|
 |
|