Codeigniter Integration

Discussion in 'Setting-up protection' started by loachman, Oct 31, 2010.

  1. loachman

    loachman Guest

    Joined:
    Aug 14, 2007
    Messages:
    23
    I am trying to get amember working with codigniter.I am using Amembers datatbase and sessions.

    I am using the manual include
    PHP:
    $_product_id = array(1,3);
    include(
    "aMember_Root_Dir/plugins/protect/php_include/check.inc.php");
     
    But no matter where I put it I get an error that I cannot access that part of the site.

    I have tried putting it a the top of the controller file,within each individual controller i.e.
    PHP:
    function homepage(){
    $_product_id = array(1,3);
    include(
    "aMember_Root_Dir/plugins/protect/php_include/check.inc.php");
    //load view here
    }
    And at the top of individual view files.


    Please Help!
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Silly question, but are you changing aMember_Root_Dir to your actual amember root directory?

    David
  3. loachman

    loachman Guest

    Joined:
    Aug 14, 2007
    Messages:
    23
    Ah yes i am.

    It protects the page but when i go to login.It tells me I am not allowed access.
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Add
    global $_product_id;
    before $_product_id = array(1,3); line.
    I guess you try to include protection code inside function or include file, so $_product_id array is not available from check.inc.php
  5. loachman

    loachman Guest

    Joined:
    Aug 14, 2007
    Messages:
    23
    That seems to have worked.

    Thanks

Share This Page