Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

[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
•••
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
•••
Thanks...:) It works!!!
Rep added.
 
0
•••
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back