From d895b852a6e160496ffc760d46d3719a3d62ff86 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Sun, 3 Feb 2008 23:23:24 +0000 Subject: Initial checkin of nutridb.org and basic subversion directory structure --- add_diary.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 add_diary.php (limited to 'add_diary.php') diff --git a/add_diary.php b/add_diary.php new file mode 100644 index 0000000..9a470e8 --- /dev/null +++ b/add_diary.php @@ -0,0 +1,36 @@ +You must give the diary a name before you can save it."; + header("Location: {$config->_previousUri}"); + exit; +} + +$sql = sprintf (" + INSERT INTO userDiaries (user, description) + VALUES('%s','%s') + ", + $_SESSION['user']['id'], + $db->escapeString($newDiaryName) +); +$db->Modify($sql); + +if ( $db->_affectedRows == 1 ) { + $_SESSION['systemMsg'] = "The diary was created successfully."; +} else { + $_SESSION['systemMsg'] = "There was an error while creating the diary."; +} + +header("Location: {$config->_previousUri}"); +exit; + +?> -- cgit v1.2.3