Jump to content


Photo

php5 help


  • Please log in to reply
1 reply to this topic

#1 weeder

weeder
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 12 October 2006 - 02:03 PM

just switched to a server using php5

now i get a error when using a script

Fatal error: Using $this when not in object context in

The error is in line 19

$output .= $this->ipsclass->compiled_templates['skin_perfect_store']->skin_feature_form_line($q,$a);

can anybody help

#2 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 12 October 2006 - 07:15 PM

$output .= $this->ipsclass->compiled_templates['skin_perfect_store']->skin_feature_form_line($q,$a);

In PHP5 ' $this-> ' is a reference to a method from a previously declared class.  When the above fires, PHP is saying that your trying to point to the ipsclass method, but it doesn't exist in any previously declared classes.

So you need to declare the class before the class method pointer fires.

Ex.

<?php

$myObj = new theNameOfTheClassThatContainsThe_ipsclass_Method();

$output .= $this->ipsclass->compiled_templates['skin_perfect_store']->skin_feature_form_line($q,$a);

?>
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users