Kép Törlés

Kép Törlés
2020-07-14T19:10:15+02:00
2020-07-14T22:00:19+02:00
2022-10-15T21:25:37+02:00
exxon
Helló Mindenki.
Szeretnék kérni egy kis segítséget,
Valamikor pár éve szépen ment a kódom de most az istenért se akarja listázni a képeket.
Mit nem veszek észre?
<?php session_start(); define('IS_ADMIN','true'); require('../core/config/config.php'); require('../core/config/config-theme.php'); require('../core/system.php'); if(!isLogged() || $user['is_admin'] == 0) { header('Location: ../index.php'); exit; } $page['name'] = 'Admin - Admin menü'; $menu['delkep'] = 'active'; if(isset($_GET['delete']) && isset($_GET['delid'])) { $delid = $_GET['delid']; $path = $_GET['path']; $db->query("DELETE FROM users WHERE id='".$delid."'"); unlink('../uploads/'.$path); header('Location: delkep.php?success'); exit; } $photos = "SELECT * FROM users ORDER BY id DESC"; // Pagination $per_page = 9; $count = $db->query($photos)->num_rows; $last_page = ceil($count/$per_page); if(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; } if($p < 1) { $p = 1; } elseif($p > $last_page) { $p = $last_page; } $limit = 'LIMIT ' .($p - 1) * $per_page .',' .$per_page; $photos.= " $limit"; $photos = $db->query($photos); require('../inc/admin/top.php'); ?> <section id="page-content"> <!-- Start body content --> <div class="body-content animated fadeIn"> <div class="row"> <div class="col-lg-12"> <br> <?php if(isset($_GET['success'])) { echo '<div class="alert alert-success"> <i class="fa fa-check-circle fa-fw"></i> Photo deleted successfully </div>'; } ?> <?php if($photos->num_rows >= 1) { ?> <table class="table table-responsive table-inverse"> <thead> <tr> <th style="text-align:center;"> # </th> <th style="text-align:center;"> Photo </th> <th style="text-align:center;"> Uploaded By </th> <th style="text-align:center;"> Imported from Instagram </th> <th style="text-align:center;"> Date </th> <th style="text-align:center;"> Actions </th> </tr> </thead> <tbody> <?php while($photo = $photos->fetch_array()) { $uploader = getProfilePicture($domain,$photo); ?> <tr> <td style="vertical-align:middle;width:100px;text-align:center;"> <?php $photo?> </td> <td style="vertical-align:middle;width:100px;text-align:center;"> <a href="<?php $domain?>/uploads/<?php $photo?>" target="_blank"> <img src="<?php echo $domain?>/uploads/<?php $uploader?>" style="height:100px;width:100px" data-toggle="tooltip" data-placement="bottom" data-title="Click to view in full size" placeholder="" data-original-title="" title=""> </a> <td style="vertical-align:middle;text-align:center;"> <?php $uploader ?> </td> <td style="vertical-align:middle;text-align:center;"> <?php switch ($photo->is_instagram) { case 1: echo 'Yes'; break; default: echo 'No'; break; } ?> </td> <td style="vertical-align:middle;text-align:center;"> <?php date("F j, Y",$photo->time)?> </td> <td style="vertical-align:middle;text-align:center;"> <a href="<?php echo $domain?>/uploads/<?php $photo->path?>" target="_blank" class="btn btn-theme"> <i class="fa fa-eye" style="color:#fff;"></i> </a> <a href="?delete=true&delid=<?php $photo->id?>&path=<?php $photo->path?>" class="btn btn-theme"> <i class="fa fa-trash" style="color:#fff;"></i> </a> </td> </tr> <? } ?> </tbody> </table> <ul class="pagination pagination-lg"> <?php if(($last_page >= $p) && $last_page > 1) { for($i=1; $i<=$last_page; $i++) { if($i == $p) { echo '<li class="active"> <a href="delkep.php?p='.$i.'"> '.$i.' </a> </li>'; } else { echo '<li> <a href="delkep.php?p='.$i.'"> '.$i.' </a> </li>'; } } } ?> </ul> <? } ?> </div> </div> </div> <!--/ End body content --> </section> <script src="<?php echo $domain?>/vendor/modernizr/modernizr.js"></script> <script src="<?php echo $domain?>/vendor/jquery/dist/jquery.js"></script> <script src="<?php echo $domain?>/vendor/bootstrap/dist/js/bootstrap.js"></script> <script src="<?php echo $domain?>/vendor/jQuery-Storage-API/jquery.storageapi.js"></script> <script src="<?php echo $domain?>/vendor/animo.js/animo.js"></script> <script src="<?php echo $domain?>/vendor/sweetalert/dist/sweetalert.min.js"></script> <script src="<?php echo $domain?>/app/js/app.js"></script> </body> </html>
Mutasd a teljes hozzászólást!
pár echo hiányzik, az biztos:

<?php $photo?> <?php $domain?> <?php $photo->path?> <?php $uploader ?> <?php $photo->id?> <?php date(...)?>
például: 
<?php echo $photo ?>
vagy:

<?= $photo ?>
(biztonságra is jó lenne figyelni, törlés rész elég borzalmasan néz ki)
Mutasd a teljes hozzászólást!

Tetszett amit olvastál? Szeretnél a jövőben is értesülni a hasonló érdekességekről?
abcd