Trying to get property of non-object

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iou2
Forum Newbie
Posts: 2
Joined: Tue Feb 14, 2012 1:49 pm

Trying to get property of non-object

Post by iou2 »

Hello, I am new here so please forgive if I am posting in the wrong thread.
Anyway, I am dedicated to have my osCommerce error free. I have been working alone for quite some time on this.
One of my last errors is this: Trying to get property of non-object. The offending line is:
if ($GLOBALS[$module]->tax_class > 0) {

I have tried things like if isset(($GLOBALS[$module]->tax_class > 0)) {

And never fixed it. How should it be?

Kind regards from Sweden
Sara
:?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Trying to get property of non-object

Post by Celauran »

$GLOBALS is an array, not an object.
iou2
Forum Newbie
Posts: 2
Joined: Tue Feb 14, 2012 1:49 pm

Re: Trying to get property of non-object

Post by iou2 »

Thanks for your answer Celauran, appreciated :)
Yes, truly so. I changed the line to read:

if (isset($GLOBALS[$module]->tax_class)) {

Now it works as intended.
If you would like to see my dev.site here it is: http://www.u2commerce.com
Its bugfree, fully validated: html, css, sql, php and the javascripts I've developed.
Next step is to remove any use of jquery... which is veeeeery buggy :(

Still, I have things to be done, before my vision is fully accomplished.

Sara
Post Reply