Exemple #1
0
                    //Скачиваем картинку, сохраняем и ресайзим
                    $content = file_get_contents($val);
                    $file = 'upload/' . $fileName;
                    file_put_contents($file, $content);
                    $this->image_resize($file, $file, '', '200', '100');
                }
            }
        }
    }
    public function images()
    {
        $html = '';
        $result = $this->sql->query("SELECT * FROM `images`");
        while ($data = $result->fetch_assoc()) {
            $html .= '<div class="item"><img src="upload/' . $data['id'] . '.' . $this->typeFile($data['url']) . '"></div>';
        }
        return $html;
    }
}
$Engine = new Engine();
switch ($_GET['mod']) {
    case 'upload':
        echo $Engine->upload();
        break;
    case 'images':
        echo $Engine->images();
        break;
    default:
        echo 'Ошибка 404, страница не найдена!';
        break;
}