NameSilo

[Resolved] Image Redirection

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
Thanks...:) It works!!!
Rep added.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back