Php_include Problem

Discussion in 'Setting-up protection' started by saklay, Sep 28, 2003.

  1. saklay

    saklay Guest

    I downloaded the free version of aMember and was able to install it successfully. Unfortunately, I've been having problems protecting my files. I know it should be a no-brainer but I followed every instructions and still didn't work.

    First I added this code on the FIRST LINE of my PHP file:
    Code:
    <?
    $_product_id = array(1);
    include("http://www.yourserver.com/amember/plugins/protect/php_include/check.inc.php"); 
    ?>
    
    
    Notice that I used absolute and not relative path in the include file. Using a relative path doesn't seem to work. But with this code, I got the following error:
    Code:
    Product ID is not defined in called script! Died.
    
    
    I opened check.inc.php and added this code (the one in bold red) instead. It's an ugly hack but at least this somehow worked.
    With this workaround, the login form appeared. I manually added a user so that I can test if the login works. I even checked .htpasswd and the user and password I added were there. In theory, when you login, it will redirect you to the same page. I did that, it redirected me to the same protected page... BUT with the login form still.

    Also, it was mentioned in the documentation that the php_include code should be placed on TOP of the page. Is it possible that I add this somewhere in the middle, something like:
    Code:
    <HTML>
    <HEAD><TITLE></TITLE></HEAD>
    <BODY>
    <?
    $_product_id = array(1);
    include("http://www.yourserver.com/amember/plugins/protect/php_include/check.inc.php"); 
    ?>
    </BODY>
    </HTML>
    
    
    Here are some info that might be useful.
    Code:
    aMember Script version: 1.8.5
    Protect plugins: htpasswd,php_include
    PHP Version 4.3.1
    System: Windows NT localhost 5.0 build 2195
    
    
    I'm already dumbfounded with this situation. I searched the whole forum and found no similar problems. Any help would be highly appreciated. I recommended this module to my client and is considering to upgrade to Pro version, that is if I can make it work. I'm really pressured coz I was supposed to deliver this yesterday.

    Thanks so much.
  2. Quaor

    Quaor Guest

    Do you have product(s) defined?
  3. saklay

    saklay Guest

    Yes, I do have a product defined, just one. That's why $_product_id has only 1 in its array. Do I need to add a few more prdoucts to make this work or will one suffice? Or is there any other reason for this to happen?

    Any help would be highly appreciated coz I'm highly pressed for time.

    Thanks.
  4. saklay

    saklay Guest

    Is there anyone in the forum who can help me with this problem? I would appreciate any insights or suggestions. I need to present it this week and should it be approved, we'll move to a Pro version.

    Hope to hear from you guys soon.

    Thanks.
  5. alex-adm

    alex-adm Guest

    I belive nothing like this is written in the docs:
    You have to use filesystem path to aMember directory.

    It looks like /home/yoursi/public_html/amember/plugins/protect/php_include/check.inc.php
    you can see path to aMember folder in aMember CP -> Info and some URLs
    add "/plugins/protect/php_include/check.inc.php" to this path and use it - it will work.

    Contact us: support@cgi-central.net if there will be any problems - you are welcome!
  6. saklay

    saklay Guest

    Hi Alex,

    It did work!!!! Thank you so much. I'll just show this to my client and hopefully they'll reconsider switching to Pro even if I'm a little late. ;)

    Thanks again. :D

Share This Page