I need to show a picture sometimes (when available). Does somebody what I need to change in this code:
<?
$caminho ="www/htdocs/imagens/fotos/";
$caminhourl ="/imagens/fotos/";
if (file_exists($caminho.$linhadocente['id_doc'].".jpg")) $foto="<img src=".$caminhourl.$linhadocente['id_doc'].".jpg border=1 width='100' height='150'>";
elseif (file_exists($caminho.$linhadocente['id_doc'].".gif")) $foto="<img src=".$caminhourl.$linhadocente['id_doc'].".gif border=1 width='100' height='150'>";
elseif (file_exists($caminho.$linhadocente['id_doc'].".bmp")) $foto="<img src=".$caminhourl.$linhadocente['id_doc'].".gif border=1 width='100' height='150'>";
else $foto="<img src='".$caminhourl."silhueta.gif' width='100' height='150' border='1' >";
echo $foto;
?>
It seems to me that they programmed it rather difficult before, or do I just think that?