From 5fd9fa480f302902328b81f912dd67ce378284f8 Mon Sep 17 00:00:00 2001 From: citizenz7 Date: Thu, 20 Apr 2017 18:50:55 +0200 Subject: V.1.4.6 --- Html/admin/add-category.php | 134 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Html/admin/add-category.php (limited to 'Html/admin/add-category.php') diff --git a/Html/admin/add-category.php b/Html/admin/add-category.php new file mode 100644 index 0000000..9e8ce8b --- /dev/null +++ b/Html/admin/add-category.php @@ -0,0 +1,134 @@ + retour sur la page login +if(!$user->is_logged_in()) { + header('Location: login.php'); +} + +if(isset($_SESSION['userid'])) { + if($_SESSION['userid'] != 1) { + header('Location: '.SITEURL); + } +} + +// titre de la page +$pagetitle = 'Admin : ajouter une catégorie'; +require('../includes/header.php'); +?> + + + + +
+ + + +
+
+ +Accueil > '); +for($i=1; $i"; + } + else $prChunks[0]=$dChunks[$i] . ' > '; + echo('">'); + echo(str_replace("_" , " " , $prChunks[0])); +} +?> +

+ + + + +

Categories Index

+

Ajouter une catégorie

+ + prepare('INSERT INTO blog_cats (catTitle,catSlug) VALUES (:catTitle, :catSlug)') ; + $stmt->execute(array( + ':catTitle' => $catTitle, + ':catSlug' => $catSlug + )); + + //redirect to index page + header('Location: categories.php?action=ajoute'); + exit; + + } catch(PDOException $e) { + echo $e->getMessage(); + } + + } + + } + + //check for any errors + if(isset($error)){ + foreach($error as $error){ + echo '

'.$error.'

'; + } + } + ?> + +
+ +


+ '>

+ +

+ +
+ +
+ + + +
+
+
+ + + + + -- cgit v1.2.1