You are here: Re: How to catch a failed opening required ... (require_once) ? « All PHP « IT news, forums, messages
Re: How to catch a failed opening required ... (require_once) ?

Posted by Don Freeman on 08/17/06 15:36

"Hans 'pritaeas' Pollaerts" <pritaeas@hotmail.com> wrote in message
news:ebd2hp$ue$1@news5.zwoll1.ov.home.nl...
>
> "Pugi!" <reply@group.svp> wrote in message
> news:lvmdnZfd_o9vnUfZRVnyrQ@scarlet.biz...
>> Hi,
>> How can you catch a fatal error that occurs when you use a
>> require_once("myfile.php") and the file dioesn't exist ?
>
> You can replace it with:
>
> <?php
> if (file_exists ("p.php")) require_once ("p.php");
> ?>
>

You would want to add an "else" clause as well (to display an error message
and then exit?), otherwise the need for the file to be required will not be
satisfied.

--
-Don
Ever had one of those days where you just felt like:
http://cosmoslair.com/BadDay.html ?
(Eating the elephant outside the box, one paradigm at a time)

 

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

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