help., gimana buat perulangan div gambar pada php tanpa input ke database

Screenshot from 2023-01-12 19-50-52.pngScreenshot from 2023-01-12 19-54-19.png

avatar argachristian
@argachristian

11 Kontribusi 1 Poin

Dipost 1 tahun yang lalu

Tanggapan

kode kamu tidak jelas. Coba ditampilkan sebagai kode bukan gambar. dan jelaskan apa yang kamu lakukan dan apa yang skearang terjadi dan maunya apa

pak kasih pencerahan, agar bisa mengimplementasikan hasil yg dipelajari 'php' ke dalam template website pak?

1 Jawaban:

<pre>Terimakasih pak @hilmanski., saya download template website ingin mengimplenmentasikan koding php apa yang sudah saya pelajari beberapa minggu ini. saya sudah menampilkan gambar di tampilan website menggunakan koding php dari directory tapi &lt;div&gt; css nya tidak ikut tampil. saya coba sana sini gk ketemu apakah salah koding atau kekurangan koding ? saya belom mengerti pak &lt;!-- ======= Portfolio Section ======= --&gt; &lt;section id="portfolio" class="portfolio"&gt; &lt;div class="container" data-aos="fade-up"&gt;

    &amp;lt;div class=&quot;section-title&quot;&amp;gt;
      &amp;lt;h2&amp;gt;Portfolio&amp;lt;/h2&amp;gt;
      &amp;lt;p&amp;gt;Check out our beautifull portfolio&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;div class=&quot;row&quot; data-aos=&quot;fade-up&quot; data-aos-delay=&quot;100&quot;&amp;gt;
      &amp;lt;div class=&quot;col-lg-12&quot;&amp;gt;
        &amp;lt;ul id=&quot;portfolio-flters&quot;&amp;gt;
          &amp;lt;li data-filter=&quot;*&quot; class=&quot;filter-active&quot;&amp;gt;All&amp;lt;/li&amp;gt;
          &amp;lt;li data-filter=&quot;.filter-app&quot;&amp;gt;App&amp;lt;/li&amp;gt;
          &amp;lt;li data-filter=&quot;.filter-card&quot;&amp;gt;Card&amp;lt;/li&amp;gt;
          &amp;lt;li data-filter=&quot;.filter-web&quot;&amp;gt;Web&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

&lt;!-- ==========looopp============ --&gt; &lt;div class="row portfolio-container" data-aos="fade-up" data-aos-delay="200"&gt;

      &amp;lt;div class=&quot;col-lg-4 col-md-6 portfolio-item filter-app&quot;&amp;gt;
        &amp;lt;div class=&quot;portfolio-wrap&quot;&amp;gt;
          &amp;lt;img src=&quot;assets/img/portfolio/portfolio-1.jpg&quot; class=&quot;img-fluid&quot; alt=&quot;&quot;&amp;gt;
          &amp;lt;div class=&quot;portfolio-links&quot;&amp;gt;
            &amp;lt;a href=&quot;assets/img/portfolio/portfolio-1.jpg&quot; data-gallery=&quot;portfolioGallery&quot; class=&quot;portfolio-lightbox&quot; title=&quot;App 1&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-plus&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
            &amp;lt;a href=&quot;portfolio-details.html&quot; title=&quot;More Details&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-link&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
          
            echo &quot;&amp;lt;img src=&#039;assets/img/portfolio/&quot; . $item . &quot;&#039;&amp;gt;&quot;;
        
      
       
          &amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;portfolio-info&quot;&amp;gt;
            &amp;lt;h4&amp;gt;App 1&amp;lt;/h4&amp;gt;
            &amp;lt;p&amp;gt;App&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;?php
      $direktori = &quot;assets/img/portfolio&quot;;
      

foreach(scandir($direktori) as $item) { if($item == "." || $item == ".."){

   }else{
        
    echo &quot;&amp;lt;img src= &#039;assets/img/portfolio/&quot; . $item . &quot;&#039;style=&#039;width: 164px; margin: 10px; vertical-align:top; display: inline-block; border: 1px solid black;&#039;&amp;gt;&quot;;
         }
         
      // tanda kutip 1 dekat photo gunanya untuk buka file
                  
  }
    ?&amp;gt;
      &amp;lt;!-- &amp;lt;div class=&quot;col-lg-4 col-md-6 portfolio-item filter-web&quot;&amp;gt;
        &amp;lt;div class=&quot;portfolio-wrap&quot;&amp;gt;
          &amp;lt;img src=&quot;assets/img/portfolio/portfolio-2.jpg&quot; class=&quot;img-fluid&quot; alt=&quot;&quot;&amp;gt;
          &amp;lt;div class=&quot;portfolio-links&quot;&amp;gt;
            &amp;lt;a href=&quot;assets/img/portfolio/portfolio-2.jpg&quot; data-gallery=&quot;portfolioGallery&quot; class=&quot;portfolio-lightbox&quot; title=&quot;Web 3&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-plus&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
            &amp;lt;a href=&quot;portfolio-details.html&quot; title=&quot;More Details&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-link&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;portfolio-info&quot;&amp;gt;
            &amp;lt;h4&amp;gt;Web 3&amp;lt;/h4&amp;gt;
            &amp;lt;p&amp;gt;Web&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;

      &amp;lt;div class=&quot;col-lg-4 col-md-6 portfolio-item filter-app&quot;&amp;gt;
        &amp;lt;div class=&quot;portfolio-wrap&quot;&amp;gt;
          &amp;lt;img src=&quot;assets/img/portfolio/portfolio-3.jpg&quot; class=&quot;img-fluid&quot; alt=&quot;&quot;&amp;gt;
          &amp;lt;div class=&quot;portfolio-links&quot;&amp;gt;
            &amp;lt;a href=&quot;assets/img/portfolio/portfolio-3.jpg&quot; data-gallery=&quot;portfolioGallery&quot; class=&quot;portfolio-lightbox&quot; title=&quot;App 2&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-plus&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
            &amp;lt;a href=&quot;portfolio-details.html&quot; title=&quot;More Details&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-link&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;portfolio-info&quot;&amp;gt;
            &amp;lt;h4&amp;gt;App 2&amp;lt;/h4&amp;gt;
            &amp;lt;p&amp;gt;App&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;

      &amp;lt;div class=&quot;col-lg-4 col-md-6 portfolio-item filter-card&quot;&amp;gt;
        &amp;lt;div class=&quot;portfolio-wrap&quot;&amp;gt;
          &amp;lt;img src=&quot;assets/img/portfolio/portfolio-4.jpg&quot; class=&quot;img-fluid&quot; alt=&quot;&quot;&amp;gt;
          &amp;lt;div class=&quot;portfolio-links&quot;&amp;gt;
            &amp;lt;a href=&quot;assets/img/portfolio/portfolio-4.jpg&quot; data-gallery=&quot;portfolioGallery&quot; class=&quot;portfolio-lightbox&quot; title=&quot;Card 2&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-plus&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
            &amp;lt;a href=&quot;portfolio-details.html&quot; title=&quot;More Details&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-link&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;portfolio-info&quot;&amp;gt;
            &amp;lt;h4&amp;gt;Card 2&amp;lt;/h4&amp;gt;
            &amp;lt;p&amp;gt;Card&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;

      &amp;lt;div class=&quot;col-lg-4 col-md-6 portfolio-item filter-web&quot;&amp;gt;
        &amp;lt;div class=&quot;portfolio-wrap&quot;&amp;gt;
          &amp;lt;img src=&quot;assets/img/portfolio/portfolio-5.jpg&quot; class=&quot;img-fluid&quot; alt=&quot;&quot;&amp;gt;
          &amp;lt;div class=&quot;portfolio-links&quot;&amp;gt;
            &amp;lt;a href=&quot;assets/img/portfolio/portfolio-5.jpg&quot; data-gallery=&quot;portfolioGallery&quot; class=&quot;portfolio-lightbox&quot; title=&quot;Web 2&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-plus&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
            &amp;lt;a href=&quot;portfolio-details.html&quot; title=&quot;More Details&quot;&amp;gt;&amp;lt;i class=&quot;bi bi-link&quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;portfolio-info&quot;&amp;gt;
            &amp;lt;h4&amp;gt;Web 2&amp;lt;/h4&amp;gt;
            &amp;lt;p&amp;gt;Web&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;

&lt;/div&gt;

  &amp;lt;/div&amp;gt;
&amp;lt;/section&amp;gt;&amp;lt;!-- End Portfolio Section --&amp;gt;

Mohon pencerahan pak. Terima kasih</pre>

avatar argachristian
@argachristian

11 Kontribusi 1 Poin

Dipost 1 tahun yang lalu

Login untuk ikut Jawaban