Read & delete entries in txt file

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 =

[code]




#enddiv[/code]

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 :
[php] $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”;
}[/php]

I’ve searched hours and tried lots of codes before posting
Help would be very appreciated. Thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service