how to ignore 404 error in fopen?

Discussion in 'PHP' started by nastynappy, Jun 20, 2008.

  1. #1
    how to ignore 404 error in fopen or get_meta_tags?

    I really need to know it..

    for example, we have a custom 404 page.
    when we use fopen on it, it gives error 404 stream thingy.
    is there any way to ignore the error and open the page and fetch its content?
    Please help !!


    Thanks in advance
     
    nastynappy, Jun 20, 2008 IP
  2. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #2
    try to put @ in front of fopen like this

    $data = @fopen('myfile.txt','r');
     
    php-lover, Jun 20, 2008 IP
  3. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This wont work.
    this will just stop executing the script without any error.
    I want the script to be executed even if there is a 404 error, in clear words:
    fetch the error 404 page

    I am using get_meta_tags to fetch the page(only meta tags) , I tried fopen
     
    nastynappy, Jun 20, 2008 IP