비교해서 넣어서 첨부파일 확장자별 이미지 표시 해볼것

돌아다니면서 구한 자료로 공부하는 공간입니다..

틀린부분이 있다면 말씀해주시면 수정하도록 하겠습니다.

※ 남을 비방하거나 욕 / 정치적인 글은 삭제 대상이 됩니다. ※

비교해서 넣어서 첨부파일 확장자별 이미지 표시 해볼것

만키로군 2 3160 0

비교해서 넣어서 첨부파일 확장자별 이미지 표시 해볼것

 

<?php

for ($j=0; $j<count($file)-1; $j++) {

    echo "<tr><td style='border-bottom:0px solid #ddd;border-top:0px solid #ff6600;padding:3px 3px;'>";

    $tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ");

    $tempdata = sql_fetch(" select substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' and bf_no='{$j}' order by bf_no ");

    echo '<img src="'. $board_skin_url .'/filetype/'. $tempdata['ext'].'.gif"> ';

    echo '<a href="'.$file[$j][href].'">'.$file[$j][source].' ('.$file[$j][size].')</a><br></td></tr>';

}

?>

[이 게시물은 만키로군님에 의해 2019-09-19 17:28:07 관리자에서 이동 됨]

,

2 Comments
만키로군 2019.09.19 16:01  
$sql = " select * from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";

    while ($row = sql_fetch_array($result))
    {
      $file_source = addslashes($row[bf_source]);
      $file_type = $$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source);
      echo "<img src='". $board_skin_url ."/filetype/". $file_type .".gif' border=0 align='absmiddle' />";
    }
만키로군 2019.09.19 17:14  
$sql = " select *, substring_index(bf_source, '.', -1) ext from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";

$result = sql_query($sql);

while ($row = sql_fetch_array($result)) echo '<img src="'. $board_skin_url .'/filetype/'. $row['ext'].'.gif" />';
제목