basic-php-16-compose.php / php
<?php require_once 'conn.php'; require_once 'functions.php'; require_once 'header.php'; _GET['topicid'])) { _GET['topicid']; } else { _GET['forumid'])) { _GET['forumid']; } else { _GET['reid'])) { _GET['reid']; } post = ''; _SESSION['user_id']; _GET['a']) and _GET['post']) and edit_mode = TRUE; } require_once 'header.php'; if (!isset(<div class=\"notice\">" . "You must be logged in to post. Please <a href=\"" . "login.php\">Log in</a> before posting a message." . "</div>"; } elseif (edit_mode and authorid) { echo "<div class=\"noauth\">" . "You are not authorized to edit this post. Please contact " . "your administrator.</div>"; } else { if (sql = "SELECT * FROM forum_posts p, forum_forum f " . "WHERE p.id = " . result = mysql_query(conn) or die('Could not retrieve post data; ' . mysql_error()); result); row['subject']; row['topic_id']; row['forum_id']; row['body']; _GET['post']; row['author_id']; } else { if (topicid = 0; reid != "") { reid; sql, result) > 0) { result); row['subject']); } } sql .= forumid"; sql,result) > 0) { result); <em>" . row['subject'] . "</em>\n"; re == ""?"":"Re: " . topicname = "Reply"; forumid == "" or forumid = 1; forumid . "'"; sql, row = mysql_fetch_array(forumname = <form id="forumpost" method="post" action=<transact-post.php>> <h3><?php echo edit_mode ?"Edit Post" :"topicname"; ?> </h3> <p> Subject:<br> <input type="text" class="subject" name="subject" maxlength="255" value="<?php echo </p> <p> Body:<br> <textarea class="body" name="body" rows="10" cols="60"><?php echo body; ?></textarea> </p> <p> <?php if (<input type="submit" class="submit" name="action" ' . "value=\"Save Changes\">\n"; } else { echo '<input type="submit" class="submit" name="action" ' . "value=\"Submit New Post\">\n"; } ?> </p> <?php echo "<input type=\"hidden\" name=\"post\" " . "value=\"post\">\n"; echo "<input type=\"hidden\" name=\"topic_id\" " . "value=\"<input type=\"hidden\" name=\"forum_id\" " . "value=\"forumid\">\n"; echo "<input type=\"hidden\" name=\"author_id\" " . "value=\"</form>\n"; } require_once 'footer.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.