PHP Fatal error with php-include method

Discussion in 'Integration' started by dev_cw, Jun 16, 2009.

  1. dev_cw

    dev_cw New Member

    Joined:
    Jun 16, 2009
    Messages:
    2
    Hello,

    I am trying to use the php-include method to have aMember protect pages of my site but I keep getting a PHP Fatal error.

    Code:
    PHP Fatal error:  Call to a member function escape() on a non-object in /Users/S2M2/root/amember/plugins/protect/php_include/bruteforce.inc.php on line 85
    I am developing using the demo version on a local server. I have created a product and I have added a few members that are assigned the product.

    I have seen other threads with this same error in the forum but did not find one that offered a solution. Am I missing something?

    Thanks.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    What script do you want to protect this way?
    It seems that there is a global variable with name $db somewhere in your script. amember use that name for mysql object so error was generated because variable was overwriten.
  3. dev_cw

    dev_cw New Member

    Joined:
    Jun 16, 2009
    Messages:
    2
    Yeah...I was thinking something like that could be the problem. I am trying to use the php-include method to build a plugin for modx. I tested it outside of modx and it works great, that was when I suspected some sort of conflict.

    Thanks.

Share This Page