topical media & game development
basic-php-16-transact-post.php / php
<?php
session_start();
require_once 'conn.php';
require_once 'http.php';
if (isset(_REQUEST['action'])) {
case 'SUBMIT NEW POST':
if (isset(_POST['body'])
and isset(sql = "INSERT INTO forum_posts VALUES (" .
"NULL," . _POST['forum_id'] .
"," . _POST['subject'] .
"','" . sql, sql");
sql = "INSERT IGNORE INTO forum_postcount " .
"VALUES (" . sql, sql = "UPDATE forum_postcount SET count = count + 1 " .
"WHERE user_id = " . sql, topicid = (postid:topicid . '#post' . _POST['forum_id']);
break;
case 'EDIT':
redirect('compose.php?a=edit&post=' . _POST['subject'])
and isset(sql = "UPDATE forum_posts " .
"SET subject='" . _SESSION['user_id'] .
", body='" . _POST['post'];
if (isset(sql .= " AND author_id=" . sql, redirID = (_POST['post']:
redirID);
break;
case 'DELETE':
if (sql = "DELETE FROM forum_posts " .
"WHERE " . "id=" . sql, _REQUEST['r']);
break;
}
} else {
redirect('index.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.