👾 php

php 같은 구조에 이미지, 설명글 다를 때 + 새창으로 이미지 띄움

(。θᗨθ。) 2022. 8. 2. 13:13
<ul>
  <?php 
    $certi_name = "c2_2207";
    $certi_alt = "설명글1";
    include($_SERVER['DOCUMENT_ROOT'] . '/ko/inc/inc_certified_list.php');
    // -------------------------------------------------------------------
    $certi_name = "c2_2112";
    $certi_alt = "설명글2";
    include($_SERVER['DOCUMENT_ROOT'] . '/ko/inc/inc_certified_list.php');
    // -------------------------------------------------------------------
    $certi_name = "c2_2111_2";
    $certi_alt = "설명글3";
    include($_SERVER['DOCUMENT_ROOT'] . '/ko/inc/inc_certified_list.php');
    // -------------------------------------------------------------------
   .
   .
   .
  ?>
</ul>
<li>
  <a href="javascript:<?=$certi_name?>()">
    <img src="/asset/images/certified/<?=$certi_name?>.png" alt="<?=$certi_alt?>">
    <p><?=$certi_alt?></p>
  </a>
  <div class="line"></div>
</li>
<script>
  function <?= $certi_name?>() {
    window.open("/asset/images/certified/<?= $certi_name?>.png", "_blank", "width=600, height=850, top=70, left=600, scrollbar=no, resizable=no");
  }
</script>
728x90