You are here: Re: PHP Best Practices « PHP Programming Language « IT news, forums, messages
Re: PHP Best Practices

Posted by Dikkie Dik on 12/25/06 14:09

>
> Like this:
> <div id="body">
> <?php include("phpincludes/server-nav.php"); ?>
> </div>


I would write this as
<?php
require_once(dirname(__FILE__) . '/phpincludes/server-nav.php');
?>

I use double quotes only for newlines and tabs. Also, PHP has a nasty
tendency to resolve relative paths with respect to the calling page, not
to the current page. So if this file was called from another directory,
the include file would be searched relative to _that_ directory first.
So I always use absolute paths.

Best regards

 

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

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