• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ignore 404 error in get_meta_tags or fopen in PHP

#1
[eluser]bilal ghouri[/eluser]
how to Ignore 404 error in get_meta_tags or fopen in PHP ?

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

I know I can add a @ to stop warnings, but 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
I am mainly trying to get the meta tags from the page ( even if it is a custom 404 error page )

Please help !!!!

Thanks in advance

#2
[eluser]Seppo[/eluser]
That is the fopen behaviour Sad
May be you can try a workaround with fsockopen or curl

#3
[eluser]bilal ghouri[/eluser]
maybe you can read again my first post.
I want to fetch page even if its a 404 page, dont stop fetching it its a 404 page

#4
[eluser]Seppo[/eluser]
That's exactly what I read... Let me explain again.
You can not do that with fopen, but you can try fetching HTTP information using other functions/libraries that might work, for example fsockopen function or curl extension.

#5
[eluser]bilal ghouri[/eluser]
I tried curl, but its too slow, ok, Ill give it a try with fsockopen , thanks for help


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.