Esempio n. 1
0
<?php

/**
 * Created by PhpStorm.
 * User: Пользователь
 * Date: 12.10.2015
 * Time: 20:18
 */
require_once __DIR__ . '/models/news.php';
if (!empty($_GET)) {
    if (isset($_GET['id'])) {
        $article = getArticleByID($_GET['id']);
        if (!empty($article)) {
            ?>
Новость:<?php 
            include 'view/index_one.php';
        } else {
            header('Location:/404.php');
        }
    } else {
        header('Location:/index.php.php');
    }
} else {
    header('Location:/index.php.php');
}
?>

Esempio n. 2
0
<?php

/**
 * Created by PhpStorm.
 * User: Пользователь
 * Date: 13.10.2015
 * Time: 19:53
 */
require_once __DIR__ . '/models/news.php';
if (!empty($_GET)) {
    if (isset($_GET['id'])) {
        $toedit = getArticleByID($_GET['id']);
        if (!empty($toedit)) {
            include 'view/editform.php';
        } else {
            header('Location:/404.php');
        }
    } else {
        header('Location:/index.php');
    }
} else {
    header('Location:/index.php');
}