채택완료

이미지 없을 때 대신 다른 이미지 뜨게 하려면 어떻게 하나요

Copy
<?php for ($i=0; $i<2; $i++) {  ?>		<?php						$sql_file="SELECT * FROM g5_board_file where bo_table='{$bo_table}' and wr_id={$list[$i]['wr_id']}";						echo "<li style ='display:table-cell;width:145px;padding:0 24px;'>";		$result_file = sql_query($sql_file);		$row_file=sql_fetch_array($result_file);		//echo "<ul class='roll_img'>";		echo "<a href=\"".$list[$i]['href']."\" style='display:inline-block;overflow:hidden;'>"; 		echo "<img onerror='this.src='noimg.gif';' src='{$g5['path']}/data/file/{$bo_table}/$row_file[bf_file]' style='width:100%;' />";   // 이미지 출력		echo "</a>";		echo "<a style='margin-top:5px;display:block' href=\"".$list[$i]['href']."\">";		echo $list[$i]['subject'];		echo "</a>";		echo "</li>";		//echo "</ul>";				 ?>	<?php }  ?><?php if (count($list) == 0) { //게시물이 없을 때  ?><span style="text-align:center;display:block;width:90%;margin:0 auto;">게시물이 없습니다.</span><style type="text/css">	.latest_board img {display:none;}</style><?php }  ?>

이미지가 없을 때 대신 뜨게 해야하는데

<img error='src='/images/..''

이렇게 해도 안됩니다.

|

답변 2개

채택된 답변
+20 포인트

'this.src='noimg.gif';'

=>'this.src=\"noimg.gif\"'

답변을 작성하려면 로그인이 필요합니다.