테스트 사이트 - 개발 중인 베타 버전입니다

글작성후 메일발송할때 이미지도 같이발송할려고합니다. 채택완료

파트라슈님 3년 전 조회 1,881

<div style='margin-bottom:20px;border-radius:20px;max-width:100%;height:auto'><img style='margin-bottom:20px;border-radius:20px;max-width:100%;height:auto' src='홈페이지주소/".$dest_file."'></div>
</div>

여기에서 두번째파일만 출력하고 싶은데요.

각각 첨부파일을 표시할려면 어떻게 해야될까요?

 

 

</p>

<p><?

 include_once(G5_LIB_PATH.'/mailer.lib.php');

 </p>

<p>if($_POST['wr_5']){

$header .= "MIME-Version: 1.0\r\n";

$header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$sql = " select bf_source, bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc";

$file_result = sql_query($sql);

$files = Array();

while($file = sql_fetch_array($file_result)){

   $dest_file = '/data/file/'.$bo_table.'/'.$file['bf_file'];

   $files[] = array("name" => $file['bf_source'], "path" => $dest_file);

}

mailer('관리자', 'demo@demo.com', $wr[wr_6] , "[관리자] ".$wr[wr_name]."님의 문의입니다." , "</p>

<p><div style='background:#f7f7f7; width:1200px; height:720px; padding:0px 30px 20px 30px;border-radius:20px;'>

<div style='float:left;width:450px;padding:0;height:100%;margin:20px 0 20px 0px'>

<div style='margin-bottom:20px;border-radius:20px;max-width:100%;height:auto'><img style='margin-bottom:20px;border-radius:20px;max-width:100%;height:auto' src='홈페이지주소/".$dest_file."'></div>

</div></p>

<p>

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

답변 1개

채택된 답변
+20 포인트
3년 전

두번째 파일만

$sql = " select bf_source, bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc";

->

$sql = " select bf_source, bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc limit 1, 1";

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 6개

파트라슈님
3년 전
답변 감사합니다. 혹시 첨부파일1 , 첨부파일2, 첨부파일3 이런형태로 출력할려면 어떻게 해야되나요?
".$dest_file." 현재 이거로는 하나만 출력되는데요.
마르스컴퍼니
3년 전
$sql = " select bf_source, bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc"; // 원래대로
~

while($file = sql_fetch_array($file_result)){
$dest_file[] = '/data/file/'.$bo_table.'/'.$file['bf_file'];
$files[] = array("name" => $file['bf_source'], "path" => $dest_file);
}

첨부파일 1 : $dest_file[0]
첨부파일 2 : $dest_file[1]
첨부파일 3 : $dest_file[2]

or

for ($i = 0; $i < count($dest_file); $i++) {
echo '첨부파일' . $i . ' : ' . $dest_file[$i];
}
파트라슈님
3년 전
감사합니다..~ 정말 잘됩니다. 꾸벅꾸벅!
행복한 저녁 되세요~
파트라슈님
3년 전
궁금한 사항이 하나 더있어서요. 첨부파일은 잘 발송이되는데요. 네이버 / 다음 메일에서는 이미지가 액박이되면서 불러오지를 못하는데 이부분은 어떻게 해야될까요? 구글(gamil)만 정상적으로 이미지가 보여지거든요
마르스컴퍼니
3년 전
그 부분은 잘 모르겠습니다.
파트라슈님
3년 전
답변 감사합니다~ ^^ 행복한 하루보내세요!!

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

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

로그인