echo '</div>'; } else { $this->msg = 'There are no images in this folder. It\'s time upload your first image!'; } } } $gallery = new ImageGallery('images/'); if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_FILES['userImage'] && !$_FILES['userImage']['error']) { $gallery->uploadImg('userImage'); } } if ($_SERVER['REQUEST_METHOD'] === 'GET' && $_GET['action'] === 'delete') { $gallery->deleteImg(strip_tags($_GET['delimg'])); } $gallery->prepareImages(); ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ font: 14px/1.5 normal Arial, Verdana, Helvetica, sans-serif; }