Unstoppable Domains

[Resolved] Image Redirection

Spaceship Spaceship
Watch

newsiness

VIP Member
Impact
49
Image Redirection

We can show the image on the web by using this script
<img src="http://......">

The image is shown on the page if the img is available. If the image is unavailable, it shows something like this
imgup2.png


Is there anyway for the php to redirect it to other img source if the current img is unavailable?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
had a quick look and found the following example on another forum:-

Code:
<html> 
<head> 
<script type="text/javascript"> 
  function fixBrokenImages(){ 
    // alle afbeeldingen uit tussen de body tags 
    var imglst = document.images; 
    for(var i = 0; i < imglst.length; i++){ 
      imglst[i].onerror = function() { 
        // weergeven als er een fout is opgetreden 
        this.src = "http://www.centcom.mil/_layouts/images/ERROR.GIF"; 
      } 
      // afbeelding refreshen omdat de onerror  
      // pas achteraf wordt ingesteld. 
      imglst[i].src = imglst[i].src; 
    } 
  } 
</script> 
</head> 
<body onload="fixBrokenImages();"> 
<img src="http://www.bonideproducts.com/images/checked.gif" /> 
<img src="http://www.bonideproducts.com/images/cheked.gif" /> <!-- FOUTIEVE URL --> 
<img src="http://www.bonideproducts.com/images/checked.gif" /> 
<img src="http://www.bonideproducts.com/images/checked.gif" /> 
</body> 
</html>
 
1
•••
Thanks...:) It works!!!
Rep added.
 
0
•••
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back