Ejemplo n.º 1
0
    $link = connectDB();
    $req = "DELETE FROM hella_posts\n                       \t\tWHERE hella_posts.post_id = " . $post_id;
    $que = mysqli_query($link, $req) or die($req);
    // Sitemap & RSS flux refresh
    sitemapGen();
    rssGen();
    $_SESSION['textInfo'] = 'Le billet a été supprimé.';
    goPage('information');
} else {
    ?>
					<h1>
						Suppression de post
					</h1>
					<?php 
    if (is_null($post_id)) {
        goPage('accueil');
    }
    $link = connectDB();
    $req = 'SELECT post_title, post_tag, post_content
							FROM hella_posts
							WHERE post_id = ' . $post_id;
    $que = mysqli_query($link, $req) or die($req);
    if (mysqli_num_rows($que) != 1) {
        ?>
						Erreur ! Retour à l'accueil !
						<?php 
        goPageTimer('accueil', 3000);
    } else {
        $res = mysqli_fetch_assoc($que);
        $title = $res['post_title'];
        $tag = $res['post_tag'];
Ejemplo n.º 2
0
					
					<?php 
    /*//////////////////////////////////////////////////////////////////////////////////////////*/
    /*///////////////////////////////////////// Process ////////////////////////////////////////*/
    /*//////////////////////////////////////////////////////////////////////////////////////////*/
    // If data in $_POST
    if (isset($_POST['save']) && $_POST['save'] && isset($_POST['shortName']) && !empty($_POST['shortName']) && isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['content']) && !empty($_POST['content'])) {
        // Data processing and set in variables
        $shortName = htmlentities($_POST['shortName'], ENT_QUOTES);
        $name = htmlentities($_POST['name'], ENT_QUOTES);
        $content = htmlentities($_POST['content'], ENT_QUOTES);
        $link = connectDB();
        $req = "INSERT INTO hella_pages (page_short_name, page_name, page_content)\n                        \t\t\tVALUES ('" . $shortName . "', '" . $name . "', '" . $content . "')";
        $que = mysqli_query($link, $req) or die($req);
        $_SESSION['textInfo'] = 'Enregistrement effectué.';
        goPage('information');
        /*//////////////////////////////////////////////////////////////////////////////////////////*/
        /*//////////////////////////////////////////////////////////////////////////////////////////*/
        /*////////////////////////////////////// Page display //////////////////////////////////////*/
        /*//////////////////////////////////////////////////////////////////////////////////////////*/
    } else {
        if (isset($_POST['shortName']) && empty($_POST['shortName'])) {
            $emptyShortName = TRUE;
        }
        if (isset($_POST['name']) && empty($_POST['name'])) {
            $emptyName = TRUE;
        }
        if (isset($_POST['content']) && empty($_POST['content'])) {
            $emptyContent = TRUE;
        }
        ?>
Ejemplo n.º 3
0
<?php

session_start();
include 'map.php';
include 'include/keys.php';
session_destroy();
generateMap();
goPage('index.php');
Ejemplo n.º 4
0
function droite()
{
    switch ($_SESSION['orientation']) {
        case 'nord':
            $_SESSION['orientation'] = 'est';
            break;
        case 'sud':
            $_SESSION['orientation'] = 'ouest';
            break;
        case 'est':
            $_SESSION['orientation'] = 'sud';
            break;
        case 'ouest':
            $_SESSION['orientation'] = 'nord';
            break;
        default:
            goPage('accueil.php');
            break;
    }
}
Ejemplo n.º 5
0
<!-- COMMUNICATION PAGE -->

<?php 
setPageTitle('Information');
if (!isset($_SESSION['textInfo']) || empty($_SESSION['textInfo'])) {
    goPage('home');
}
?>

<div class="row">
	<div class="large-12 medium-12 small-12 columns">
		<div class="panel">
			<?php 
echo $_SESSION['textInfo'];
$_SESSION['textInfo'] = '';
?>
		</div>
	</div>
</div>