professional-sql-10-public-files-post-admin.php / php
<?php // include shared code include '../lib/common.php'; include '../lib/db.php'; include '../lib/functions.php'; // this should not be available unless the user has logged in include '401.php'; // insert a new blog entry if (query = sprintf('INSERT INTO\ %sBLOG_POST SET POST_TITLE = "\ %s", ' . 'POST_DATE = "\ %s", POST_TEXT = "\ %s"', DB_TBL_PREFIX, mysql_real_escape_string(GLOBALS['DB']), mysql_format_date(_POST['post_text'], query, // delete entry if (isset(_POST['delete'])) {\ %sBLOG_POST WHERE POST_ID =\ %d', DB_TBL_PREFIX, _POST['post_id']); mysql_query(GLOBALS['DB']); } // update entry else {\ %sBLOG_POST SET POST_TITLE = "\ %s", ' . 'POST_DATE = "\ %s", POST_TEXT = "\ %s" WHERE POST_ID =\ %d', DB_TBL_PREFIX, mysql_real_escape_string(_POST['post_title'], _POST['post_date']), mysql_real_escape_string(GLOBALS['DB']), query, GLOBALS['DB']); header('Location: admin.php'); ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.