Hello, I'm requesting your help here cause I'm really confused.
I'm looking for deleting entries when an image doesn't load on my links test.
I got all my links in a .txt file like this :
links.txt =
<div class="gallery">
<a href="http://www.website.com/page">
<img src="http://tc16.easythumbhost.com/image.jpg" onerror="ImgError(this)"/>
</a>
</div>
#enddiv
the "onerror" code in img src sends an "Image Missing" pic.
What I'd want is to change the "onerror" function to open a php script which deletes all the lines of the div.
This is the script I use to show the links on my page :
$links = "links.txt";
$fd = fopen ($links, "r");
$content = fread ($fd,filesize ($links));
fclose ($fd);
$delimiter = "#enddiv";
$splitcontent = explode($delimiter, $content);
$output = array_slice($splitcontent, 0,100);
foreach ( $output as $divs )
{
echo "$divs";
}
I've searched hours and tried lots of codes before posting
Help would be very appreciated. Thanks.