Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Cannot re-assign $this in /


technophobe

Recommended Posts

My site has been running fine for the last few years and noticed that the SQL database file was close to the maximum that was permited under my current service plan (100mb)

So i contacted 1and1 to upgrade and they suggested another service plan.

So i went ahead and after the upgrade, i got an error mesage saying: FATAL ERROR: register_globals

So i added a PHP.ini file into the root of the site with register_globals=on in the file.

This solved the problem, untill i tried to log into the admin side, where i got the same error, so i put the same php.ini into the adming folder, but this i get this error.

 

Fatal error: Cannot re-assign $this in /homepages/####/admin/includes/classes/upload.php on line 31

 

 

This is an extract from the upload.php.

 

if (tep_not_null($this->file) && tep_not_null($this->destination)) {

$this->set_output_messages('session');

 

if ( ($this->parse() == true) && ($this->save() == true) ) {

return true;

} else {

// self destruct

$this = null;

 

return false;

}

}

}

 

function parse() {

global $messageStack;

 

if (isset($_FILES[$this->file])) {

$file = array('name' => $_FILES[$this->file]['name'],

'type' => $_FILES[$this->file]['type'],

'size' => $_FILES[$this->file]['size'],

'tmp_name' => $_FILES[$this->file]['tmp_name']);

} elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {

global $HTTP_POST_FILES;

 

$file = array('name' => $HTTP_POST_FILES[$this->file]['name'],

'type' => $HTTP_POST_FILES[$this->file]['type'],

'size' => $HTTP_POST_FILES[$this->file]['size'],

'tmp_name' => $HTTP_POST_FILES[$this->file]['tmp_name']);

} else {

$file = array('name' => (isset($GLOBALS[$this->file . '_name']) ? $GLOBALS[$this->file . '_name'] : ''),

'type' => (isset($GLOBALS[$this->file . '_type']) ? $GLOBALS[$this->file . '_type'] : ''),

'size' => (isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : ''),

'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : ''));

}

 

 

I am a bit stumpts why it works on the customer side of the website but not on the admin side.

 

Also when i talked to 1 and 1 they said they have a policy that they wont change back to the previouse service for 30 days. :(

 

 

If anyone can point me in the right direction that would be great.

zappautomation

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...