Results 1 to 2 of 2

Thread: Code problems

  1. #1

    Code problems

    I've had a script running on my server for a good few months now that would display an image called 404.gif, if an image was not located.
    A friend of mine set it up, but Im not really sure why it's stopped working now.

    So say you had:

    That image is not on the server, it would display my 404.gif saying
    "Image Not Found".

    The php script is located in my main dir and is called error.php and the 404.gif is in my "images" folder.
    if(preg_match('/(png|jpg|gif|jpeg)$/i', $_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] != 'images/404.gif') {
        header('Content-type: image/gif');
    } else {
        echo '404 Error, file not found';

  2. #2
    Join Date
    Jun 2002
    Move to the Programming forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts