Jump to content

Broken Image Link


oneblueaugust

Recommended Posts

I've been sitting here thinking of how to do this, and I'm completely stumped. It may not be possible, but I thought I'd ask, as there's tons of people here more knowledgeable than I am.

 

Is there a way to write a script that will recognize a broken image link on a page? If so, is there a way to have that same script insert a stock image where the broken image was supposed to be (a "temporarily unavailable .gif" or something). This would be great to eliminate all those nasty red x's that I'm running into.

 

Thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/182120-broken-image-link/
Share on other sites

Where are the images coming from and how are they getting populated into your HTML output? A broken image in HTML will look the same in HTML as a regular image.

 

You could use php or javascript to test the images. But I would consider using .htaccess

 

Just depends on your specific needs.

 

 

Link to comment
https://forums.phpfreaks.com/topic/182120-broken-image-link/#findComment-960830
Share on other sites

The pictures are hotlinked from one of my other sites to my new one, so that they appear in my product listings. However, my new site has a bunch of products that my old one doesn't, so there's no pictures for them yet. So every other product has a red X populating the image slot, which sucks.

Link to comment
https://forums.phpfreaks.com/topic/182120-broken-image-link/#findComment-960837
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.