You are here: Re: Managing includes « HTML « IT news, forums, messages
Re: Managing includes

Posted by dorayme on 06/27/07 10:55

In article <46823319$0$995$afc38c87@news.optusnet.com.au>,
Disco Octopus <discooctopus@gmail.com> wrote:

> dorayme wrote:
....
>
> In your php.ini file, or you .htaccess file, or your httpd.conf file,
> you have a include setting...
>
> This would be unique to the server. So you only really need to enter
> your include like this....
>
> <? include "section.inc"; ?>
>
> You should look into the "include_path" setting in php.
>
> *or*, you could do something like this.... (but then, you may need to
> include this chunk of code into its own included thing???)
>
>
> <?php
> $GLocalDev1 = 'l-mylocallinuxserver.com';
> $GLocalDev2 = 'l-mylocalmacserver.com';
> $GLocalDev3 = 'l-mylocalpcserver.com';
> $GLive = 'live-site.example.com.au';
> if ($_SERVER['HTTP_HOST'] == $GLocalDev1){
> $IncludePath = "e:/inetpub/abc12345/includes/";
> }
> elseif ($_SERVER['HTTP_HOST'] == $GLocalDev2){
> $IncludePath = "/home/www/mywebsite/includes/";
> }
> elseif ($_SERVER['HTTP_HOST'] == $GLocalDev3){
> $IncludePath = "/whatever/your/mac/path/is/includes/";
> }
> include $IncludePath . "section.inc";
> ?>

Thanks Disco Octopus, will look at it tomorrow... one thing is
this, I can fiddle about as I please with my own server but have
little control over a public Windows server and am looking to an
avenue that does not involve altering that server if possible. I
ftp things up and that causes the least trouble, no awkward
communications needed with giant ISP concerned. My plan (snipped
above) has that going for it (even if it is a bit inelegant).

--
dorayme

 

Navigation:

[Reply to this 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

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