Re: Include problems

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

 



On Sat, Apr 12, 2008 at 11:06 PM, Bojan Tesanovic <btesanovic@xxxxxxxxx> wrote:
>
>  On Apr 12, 2008, at 8:28 AM, GoWtHaM NaRiSiPaLli wrote:
>
>
> > if(file_exists("../common/config.ini")) {
> >  $configData = parse_ini_file("../common/config.ini");
> > } else {
> >
>
>
>  Try changing above code so it reads
>
>
>  if(file_exists("common/config.ini")) {
>   $configData = parse_ini_file("common/config.ini");
>  } else {

    In your primary file, you could also consider adding:

<?php
$base_path = dirname(__FILE__);
?>

    And then, all includes from within that file would be included as such:

<?php
include($base_path.'/common/config.ini');
?>

    Finally, on a different note, it may not be in your best interest
to keep a .ini extension on a configuration file, since this is
generally readable on the web.

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux