Php Include Error

Discussion in 'Setting-up protection' started by John Jackman, Jul 26, 2003.

  1. John Jackman

    John Jackman Guest

    When using the PHP include method to protect member page, i have included the following in the header of the index.php page:


    <?php
    $_product_id = array(1); // or $_product_id = array(2) if it so
    include("/www/htdocs/changingchannelsorg/amember/plugins/protect/php_include/check.inc.php");
    ?>

    This works, but with a WARNING at the top of both the login and index the pages:

    ---------------------
    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/local/etc/httpd/htdocs/changingchannelsorg/members/index.php:2) in /usr/local/etc/httpd/htdocs/changingchannelsorg/amember/plugins/protect/php_include/check.inc.php on line 124
    ------------------------

    What's wrong?

    Thanks!

    John
  2. alex-adm

    alex-adm Guest

    <? should be in very top of page, no spaces/texts before

    Or add <? session_start(); ?> to very top of page, then you can keep code where it resides.
  3. etraak

    etraak Guest

    I have tried everything to place the php_include in my site with no luck. Here is the error that I get:

    Warning: Failed opening '/member/plugins/protect/php_include/check.inc.php' for inclusion (include_path='./:/usr/local/lib/php') in /home/site/root-URL/helpworks/index.php on line 4

    Any help would be great!!

    Bob
  4. alex-adm

    alex-adm Guest

    Bob, you are using incorrect path to aMember. You have to understand difference between URL paths and filesystem paths.

    In your case, include statement must be like:
    include '/home/site/root-URL/member/plugins/protect/php_include/check.inc.php';

Share This Page