Custom error message on includes

Discussion in 'PHP' started by ndogg, Jun 4, 2006.

  1. #1
    How can I make a custom message show up when an included txt file on a PHP page isn't found?
     
    ndogg, Jun 4, 2006 IP
  2. gopher292

    gopher292 Peon

    Messages:
    64
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    error_reporting(0);
    if(!include('include.txt')) echo "Include()'d text file not found!\n";
    error_reporting(1);

    Take note of what the error_reporting() level is before changing it and use that instead of 1.
     
    gopher292, Jun 4, 2006 IP