rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 4429bdd962d1c3bfa3855a1c1a60fc74b322d7b1
parent 93df30a0d1b3e534a2e87f81216a98928d658307
Author: MTRNord <mtrnord1@gmail.com>
Date:   Fri, 16 Jan 2015 19:37:27 +0100

new try

Diffstat:
Mcore/backend/admin/blog/newpost.php | 39+++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/core/backend/admin/blog/newpost.php b/core/backend/admin/blog/newpost.php @@ -19,36 +19,35 @@ if ($root_3[1] == 'core') { } include($root . '/core/config/variables.config.php'); include($root . '/core/config/connect.db.inc.php'); -$url = $_SERVER["DOCUMENT_ROOT"]; while (ob_get_status()) { -if ($resultat = $connection->query('SELECT id FROM posts')) { - while($daten = $resultat->fetch_object() ){ - $post_id_clean = $daten->id; - $ids = $post_id_clean+1; - #var_dump($daten); + if ($resultat = $connection->query('SELECT id FROM posts')) { + while($daten = $resultat->fetch_object() ){ + $post_id_clean = $daten->id; + $ids = $post_id_clean+1; + var_dump($daten); + } + #$resultat->close(); } - #$resultat->close(); -} -if (isset($_POST['author']) && isset($_POST['title']) && isset($_POST['content']) && isset($_POST['category'])) { + + $author = $_POST["author"]; $author = $_POST['author']; $title = $_POST['title']; $text = $_POST['content']; $category = $_POST['category']; -} -echo $author; -echo $title; -echo $text; -echo $category; -echo "test"; + echo $author; + echo $title; + echo $text; + echo $category; + echo "test"; -if (!empty($author) || !empty($title) || !empty($text) || !empty($category)) { - if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', 'date('Y-m-d H:i:s')', '$category')")) { - $resultat->close(); + if (!empty($author) || !empty($title) || !empty($text) || !empty($category)) { + if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', 'date('Y-m-d H:i:s')', '$category')")) { + $resultat->close(); + } } -} -ob_end_clean(); + ob_end_clean(); } //header( "Location: ../../../../" ); ?> \ No newline at end of file