Beispiel #1
0
<?php

require_once "functions/file_handling.php";
require_once "functions/img_resize.php";
if (isset($_POST['submit'])) {
    $file = $_FILES['file'];
    $err = is_valid_file($file);
    if (!$err) {
        change_location($file['tmp_name'], $file['name']);
        img_resize("uploads/" . $file['name'], "img_preview/" . $file['name'], 200, 200);
    }
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Галерея</title>
	<meta charset="utf-8"/>
	<meta name="description" content="This is the main page of my site"/>
	<link rel="stylesheet" href="../lesson-5/css/style.css" type="text/css">
	<link rel="stylesheet" href="style.css" type="text/css">
	<link href='https://fonts.googleapis.com/css?family=Comfortaa:400,300,700&subset=latin,cyrillic,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css'/>
</head>
<body>
<div class="content">
	<ul class="main-menu">
		<li>
			<h1><a href="#">Home</a></h1>
		</li>
		<li><a href="#">Статьи</a></li>
		<li><a href="#">Каталог</a></li>
Beispiel #2
0
<?php

require_once "functions/file_handling.php";
require_once "functions/img_resize.php";
require_once "functions/mysql_db_service.php";
require_once "functions/reviews.php";
if (isset($_POST['submit'])) {
    $file = $_FILES['file'];
    $err = is_valid_file($file);
    if (!$err) {
        $img_name = insert_into_db($file);
        change_location($file['tmp_name'], $img_name);
        img_resize("uploads/" . $img_name, "img_preview/" . $img_name, 200, 200);
    }
}
function select_images()
{
    $conn = connect();
    $arr = array();
    $query = mysql_query("SELECT name, time_seen FROM images ORDER BY time_seen DESC", $conn);
    while ($row = mysql_fetch_assoc($query)) {
        $arr[] = $row;
    }
    return $arr;
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Галерея</title>
	<meta charset="utf-8"/>