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]
|