Reply to Re: includes and paths and organization

Your name:

Reply:


Posted by Confused but working on it on 09/25/07 17:32

On 2007-09-25 04:31:14 -0700, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> said:

> <snip>
>
> Hi Ron,
>
> In addition to what Jerry and Lars wrote:
>
> I prefer making one or two directories where I store my includes, and
> simply add them to the include path. This makes things easy to manage.
>
> You can use ini_set, eg:
> $newIncludePath =
> get_include_path().PATH_SEPARATOR.'/home/bla/public_html/includes';
>
> ini_set("include_path",$newIncludePath);
>
>
> You only need 1 file you include everywhere in all your scripts that
> contains this, and you are fine.
> If you ever move your directorytree, just adjust the path.
>
> Now you can simply include everything that is stored under
> /home/bla/public_html/includes, and also its subdirectories (if you
> name them during your include).
>
>
> Regards,
> Erwin Moller

Not sure I understand this.
Make an includes directory and put my header and footer in there plus
any other file I make that will be includes. I can see in your example
how this is working.

Is ini_set in my php.ini? (I don't really like to mess with this.)

So instead of:
<?php include($_SERVER['DOCUMENT_ROOT']."includes/header.php"); ?>
I would use?
<?php include($newIncludePath."/header.php"); ?>
or:
???

If Jerry's way works, what is the advantage?

Really appreciate the help. I have a PHP MySQL book by sams and the
don't really get into this.

Thanks for te hlp.
Ron

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация