<Solved>load default pic when original is missing
A small contribution to this forum and thks for the people who helped me :)
Just finished this code. Put your HTML document(s) in the variable $Dataentry , then the code check for .jpg and automaticaly had :
onerror='this.src="Pictures/default.jpg"'/ (Thks for you help Snib!)
So if the original picture is missing a default picture is loaded instead.
<?php
$changetext='.jpg\"';
$jpgtext='.jpg\" onerror=\'this.src=\"Pictures/default.jpg\"\'/';
$Dataentry=str_replace($changetext,$jpgtext,$Datae ntry);
$Dataentry = stripslashes($Dataentry);
echo $Dataentry;
?>
|