コード例 #1
0
ファイル: delete_article.php プロジェクト: nicumih/avocatis
<?php

require_once 'db_conection.php';
require_once 'functions.php';
require_once 'session.php';
confirm_logged_in();
?>

<?php 
$article = find_article_by_id($_GET["article"]);
if (!$article) {
    redirect_to("basiclocalchat.php");
}
$id = $article["id"];
$query = "DELETE FROM articles WHERE id = {$id} LIMIT 1";
$result = mysqli_query($connection, $query);
if ($result && mysqli_affected_rows($connection) == 1) {
    redirect_to("basiclocalchat.php");
} else {
    redirect_to("basiclocalchat.php");
}
mysqli_close($connection);
コード例 #2
0
ファイル: post.php プロジェクト: nicumih/proiectt
 <?php 
require_once 'inc/db_connection.php';
?>
    <?php 
require_once 'inc/functions.php';
$name = 'post';
include 'inc/header.php';
$article = find_article_by_id($_GET['article']);
?>

    <!-- Page Header -->
    <!-- Set your background image for this header on the line below. -->
    <header class="intro-header" style="background-image: url('img/post-bg.jpg')">
        <style text="css/styleshit">
        .row{
            text-align: justify;
        }
        </style>
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    <div class="site-heading">
                       <h1> <?php 
echo htmlentities($article["menu_name"]);
?>
 </h1>
                        <hr class="small">
                        <h2 class="subheading"><?php 
echo htmlentities($article["description"]);
?>
</h2>