no 이미지 적용

no 이미지 적용

QA

no 이미지 적용

본문

                    <?php

                    if (!$list[$i]['is_notice']) {

                        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

 

                        if($thumb['src']) {

                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img"  

 

onerror="this.src='/img/list_s.jpg'">';

 

이거 이렇게 추가 했는데 오류가 나는데. 경로 문제인가용?

                     

이 질문에 댓글 쓰기 :

답변 1

if($thumb['src']) { 

윗 줄 삭제하고 이렇게.. 

$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img" onerror=\'this.src="/img/list_s.jpg"\'>'; 

위에서 if($thumb['src']) { 여기를 삭제했으면 밑에 닫는 부분 } 이 있을 텐데 거기도 삭제 

 

전체를 보면 대략 이렇게..

<?php

if (!$list[$i]['is_notice']) {

    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

    $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img" onerror=\'this.src="/img/list_s.jpg"\'>';

    echo $img_content;

}

?>

답변을 작성하시기 전에 로그인 해주세요.
전체 74
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT