You are here: Re: 'require_once' or 'include' security question « PHP Language « IT news, forums, messages
Re: 'require_once' or 'include' security question

Posted by Ian Hobson on 10/11/07 21:30

David Basford wrote:

> I'd followed what I read and used .INC files to hold important info like
> usernames and passwords for the different access levels that different pages
> might use.
>
> Isn't that rubbish?
> shouldn't these pages be .PHP files you require_once ?
>
In my opinion you are right - you should include or require .php files,
so that their content is harder for a hacker to see. The downside is
that it is not clear which .php files are properly executable and which
are not.

Both the require and include commands will process any file name you
care to give it, so both .inc and .php work just fine.

One gives an error message if the file is missing, and the other causes
the processing to die. IIRC include errors, and require dies.

The include_once and require_once are useful in shared files that may be
called in by more than one included/required file. They ensure that the
content is processed once even if there are multiple calls.

Regards

Ian

 

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

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