Firstly I would like to say I know extremely minimal about php and the only way I can use it is by modifying sumthing and seeing what it does but I do sorta undrtsnad how bits of it work.

I am using this automated article site builder thing that when given articles it converts them into php pages using templates created with tag things like #ARTICLE_BODY#. This uses ppc codes in the builder but instead of using the code there I have decided to use an include thingo. THis is the include that I am adding instead of the ppc code.

<?php include("ppc1.inc"); ?>

I then create a ppc1.inc file in the main folder. This is what I need help with if it is possible. The builder creates many directories and when the pages are uploaded it requires that the ppc1.inc file be in every directory that has a page using the include. How do I get it so I only have the ppc1.inc in the main folder? ie the public_html of the domain. I know how to use it with the domain by using the web address to the ppc1.inc in the include but I want to know how to do it without doing this.

Thnx in advance (hopefully 😛)

    You can configure PHP to look for include files in one or more directories via the include_path setting in the php.ini file or in a local .htacess file. Alternatively, you could specify to look for it in your root web directory with:

    <?php
    include $_SERVER['DOCUMENT_ROOT'] . '/ppc1.inc';
    ?>
    

      Thnx heaps. That is exactly what I wanted. I just tested it out to make sure and it works 😃 You have just saved me so much work.

      Now I might be able to make some money off these adsense sites 😃

        Write a Reply...