#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Hi,

    This is a very simple problem and I am sure there is just as simple way of solving it. I am accessing the directory structure and want to catch any errors.

    Code:
    $dir_handle = dir("/this/directory") or
    die ("Error Message");

    This catched the error but also outputs a php error to go with it. Is it as simple as changing the error handling messages in the php.ini file? Currently this is set to 7 or is there a piece of code that will cancel the php error output.

    Thanks for any help.

    Falcon.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    77
    Rep Power
    15
    Hi falcon,

    It depends on what you want to do with the error: do you want to log it, use it as a trigger signal, or just ignore it?
    If you just want to silently ignore errors, change the error handling in the php.ini file (i.e. set the code to 8).

    If you want to do something with it, just write a function which is triggered when an error occurs:

    function DoSomething()
    {
    .....;
    [break];
    [exit];
    }

    $dir_handle = dir("/this/directory") or
    die (DoSomething());

    Regards,
    Peter

    [This message has been edited by PAV (edited January 25, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Thanks for your help Peter,

    I decided to change the code to 8 and that is exactly what I wanted. I might change the error reporting to a log later but its working perfectly now.

    Thanks again.

    Falcon.

    [This message has been edited by falcon (edited January 25, 2000).]

Similar Threads

  1. Requesting help on READTEXT statement
    By hdokes in forum MS SQL Development
    Replies: 1
    Last Post: March 19th, 2004, 08:53 AM
  2. Question about the WHERE statement
    By layz d in forum MS SQL Development
    Replies: 5
    Last Post: January 28th, 2004, 11:58 AM
  3. how can i put an IF statement inside a WHILE statement?
    By Jarrett Green in forum Perl Programming
    Replies: 4
    Last Post: December 22nd, 2003, 10:05 PM
  4. Update database/count statement
    By Signuml99 in forum Database Management
    Replies: 2
    Last Post: November 26th, 2003, 01:07 PM
  5. selct statement help
    By p_murugappan in forum PHP Development
    Replies: 7
    Last Post: September 25th, 2003, 10:51 AM

IMN logo majestic logo threadwatch logo seochat tools logo