<?php
session_start();
if (isset($_POST['titre']) AND isset ($_POST['article']))
{
require_once("../user/config.php");
require_once('../user/verifications.php');



$date = "42";
$titre = addslashes($_POST['titre']);
$article = addslashes($_POST['article']);
$bdd = new PDO("mysql:dbname=$base;host=$server", "$user", "$passwd");
$req = $bdd->prepare('INSERT INTO article(user,titre,article) VALUES (:user, :titre, :article)');
$req->execute(array(
		"user" => $username,
		"titre" => $titre,
		"article" => $article,

));
echo "Votre article a bien �t� enregistr� ! <a href='".$root_path."'>Retour</a>";
//echo date_default_timezone_set('l jS \of F Y h:i:s A');
}
else
{
echo "Il y a eu une erreur.";
}
?>