rendered paste body<?php
session_start();
if(!session_is_registered('member_ID')) :
header('Location: index.php');
endif;
?>
<?php
mysql_connect("localhost", "my_user", "my_passoword");
mysql_select_db("my_database");
if(isset($_POST["title"])){
mysql_query("INSERT INTO posts (title, date, content) VALUES ('{$_POST["title"]}', '{$_POST["date"]}', '{$_POST["content"]}');");
header('Location: index2.php?mode=new_post');
exit;
}
?>
<p><font size="5"><strong>New Post</strong></font></p>
<br />
<form method="POST" action="post.php">
<table>
<tr><td>Title:</td><td><input type="text" name="title" /></td></tr>
<input type="hidden" name="date" value="<?php print date('j F Y'); ?>" />
<tr><td>Content:</td><td><textarea name="content" rows="10" cols="65"></textarea></td></tr>
<tr><td></td><td><input type="submit" value="add" /></td></tr>
<tr><td></td><td><a href="index2.php">Cancel</a></td></tr>
</table>
</form>