Re: Re: Making includes easy.... Am I a 'tard?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The inludes folder is thrown around as more of a
generic term for a directory that includes important
files. Is this a pretty good definition for the
purpose of an 'includes' folder? 

Also, I've seen the following syntax before:
(__FILE__). Why the underscores?

thanks-




--- Jason Barnett <jason.barnett@xxxxxxxxxxxxx> wrote:

> I haven't bothered to benchmark this, but here is my
> own solution to 
> this problem.  If you already have a common file
> that you are including 
> in every script then the cost should be very low. 
> Feel free to use it 
> if you prefer.
> 
> Apache
>    htdocs
>      site1
>        includes
>          common.php
>          test_include.php
>          testfolder
>            test2.php
>      site2
>        includes
>          (those four files)
>      etc...
> 
> <!-- common.php -->
> <?php
> 
> $basedir = dirname(__FILE__) . '/';
> 
> ?>
> 
> <!-- test_include.php -->
> <?
> 
> include_once common.php;
> /** Now you can include files relative to the base
> directory */
> include_once $basedir . 'testfolder/test2.php';
> 
> ?>
> 
> 
> -- 
> Teach a person to fish...
> 
> Ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html
> PHP Manual: http://php.net/manual/
> php-general archives:
> http://marc.theaimsgroup.com/?l=php-general&w=2
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


=====

----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux