CodingStudent 0 Posted February 6 Share Posted February 6 Hi firends, there is a store named "baslik". i try to creating photo gallery. i am saving photo and photo's name in database. Photo's name store named "baslik". Now, For example i am saving called "Summer Photos". i saved 10 photos. When i pull the images and names, all photos and names are pulling. I want to pull one image and its name from "baslik" store. "baslik" store's type "varchar" When i click the image's name, it should post other "Summer Photos". Image gallery should creating next to next like 1. image. And When i clicked the image, other images should open. For example when i clicked "meeting" image, it should go other "meeting" images. So, i want to categorize the images. You can look i put images. Quote Link to post Share on other sites
maxxd 104 Posted February 6 Share Posted February 6 OK - you know what you want to do, which is good. What have you done so far to get there? What's the question? Quote Link to post Share on other sites
CodingStudent 0 Posted February 6 Author Share Posted February 6 So sorry. :) i didn't put the codes. multipleimagelistingform.php <h3> Multiple Image Upload </h3> <form action="multipleimageprocesspage.php" method="POST" enctype="multipart/form-data"> <!--<span> Add Title </span><br> <input type="text" name="coklubasliklistele" /><br><br>--> <span> Add Title </span><br> <input type="text" name="baslik"><br><br> <!--<span> Resim Id </span><br> <input type="number" name="resim_id"><br><br>--> <span> Image Upload </span> <br> <input type="file" name="files[]" multiple><br> <input type="submit" value="Yükle" name="submit" /> </form> <button style="margin-top:7px;" onclick="document.location='cokluresimlisteleformu.php'">Yenile</button> multipleimageprocesspage.php <?php include "../../../baglanti.php"; ?> <?php if(isset($_POST['submit'])){ $baslik = $_POST['baslik']; $resimid = $_POST['resim_id']; // Count total files $countfiles = count($_FILES['files']['name']); // Prepared statement $query = "INSERT INTO cokluresimlistele (cokluresimlistele_resim, cokluresimlistele_baslik, baslik, resim_id) VALUES(?,?,?,?)"; $statement = $db->prepare($query); // Loop all files for($i=0;$i<$countfiles;$i++){ // File name $filename = $_FILES['files']['name'][$i]; // Location $target_file = '../../../upload/cokluresimlistele/'.$filename; // file extension $file_extension = pathinfo($target_file, PATHINFO_EXTENSION); $file_extension = strtolower($file_extension); // Valid image extension $valid_extension = array("png","jpeg","jpg"); if(in_array($file_extension, $valid_extension)){ // Upload file if(move_uploaded_file($_FILES['files']['tmp_name'][$i],$target_file)){ // Execute query $statement->execute(array($filename,$target_file,$baslik,$resimid)); } } } echo "File upload successfully"; } ?> image-gallery.php <?php include "baglanti.php"; ?> <?php $resim = $db->query("SELECT * FROM cokluresimlistele"); foreach($resim as $resimekle) { ?> <div class="resim"> <img src='upload/cokluresimlistele/<?php echo $resimekle["cokluresimlistele_resim"]; ?>' /> <div class="resimyazisi"><a href='admin/panel/production/cokluresimlistele.php'><?php echo $resimekle["baslik"]; ?></a></div> <div class="silduzenle"> </div> </div> <?php } ?> Quote Link to post Share on other sites
CodingStudent 0 Posted February 10 Author Share Posted February 10 My problem haven't solved yet. No one answering? 🙂 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.