Jump to content

tonysoprano

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tonysoprano's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

0

Reputation

  1. OK, si daca in folderul Upload sunt 40 de imagini cum stie care este imaginea adaugata de Georgescu? Imaginile se pun cu numee aleatorii in folderul Upload.
  2. <h2>Imagini</h2> <div class="table-responsive"> <table class="table table-hover table-dark"> <tbody> <?php $working_dir = getcwd(); //get image directory $img_dir = $working_dir . "/upload/"; //change current directory to image directory chdir($img_dir); //using glob() function get images $files = glob("*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}", GLOB_BRACE ); //again change the directory to working directory chdir($working_dir); //iterate over image files foreach ($files as $file) { ?> </td><td><a href="<?php echo "upload/" . $file ?>" target="_blank"><img src="<?php echo "upload/" . $file ?>" style="height: 100px; width: 100px;"/></a></td></tr> <?php } ?> </tbody> </table> Deci toate pozele din folderul Upload vreau sa le puna in tabel la fiecare user in parte care adauga poze, am gasit scriptul de mai sus dar nu stiu cum il integra la scriptul care pune numele si adresa la useri Sau daca se poate sa mi adauge alt rand in tabel cand se adauga imagini noi in folderul Upload
  3. am urmatorul script: <div class="table-responsive"> <table class="table table-hover table-dark"> <thead> <tr> <th scope="col">Nume</th> <th scope="col">Prenume</th> <th scope="col">Adresa</th> </tr> </thead> <tbody> <?php if(file_exists("log.txt")){ $bin = file_get_contents("log.txt"); $bin = explode("\n", $bin); foreach($bin as $bins) { $bins = explode("|", $bins); $Nume = $bins[0]; $Prenume = $bins[1]; $Adresa = $bins[2]; if($Nume == "") { }else{ echo "<tr> <td>".$Nume."</td> <td>".$Prenume."</td> <td>".$Adresa."</td> > </tr>"; } } }else{ echo "<tr><td>Oops :(</td><td></td><td></td></tr>"; } ?> cum pot sa fac la fiecare coloana de tabel sa mi printeze si imaginile din folderul Upload atunci cand un user se inregistreaza? am acest cod da nu stiu cum sa l integrez in scriptul de mai sus. $dirname = "upload/"; $images = glob($dirname."*"); foreach($images as $image){ echo '<a href="'.$image.'" target="_blank"><br><img src="'.$image.'" height="100" width="100" /></a> <br>==============='; } Sper sa ma fi facut inteles, imi cer scuze daca am omis ceva sunt inca incepator. Multumesc anticipat.
×
×
  • Create New...