Location: PHPKode > projects > WH Community > wh_community/admin/blog_posts_new.php
<?php include('files/header.php'); ?>
<div id="content-outer">
<div id="content">

	<div id="page-heading">
		<h1><?php echo $lang_admin['blog_article_manage']; ?></h1>
	</div>
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="files/shared/side_shadowleft.jpg" width="20" height="300" alt="shadow_l"></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="files/shared/side_shadowright.jpg" width="20" height="300" alt="shadow_r"></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td><div id="content-table-inner">
			<div id="table-content">
			<p><?php
		
			if(isset($_POST['submitted'])) {
			if(empty($_POST['title'])) {
			echo '<p>' . $lang_admin['no_title'] . '</p>';
			
				}else{
				$title = $_POST['title'];
				}
			
			if(empty($_POST['name'])) {
			echo '<p>' . $lang_admin['no_author'] . '</p>';
			
				}else{
				$name = $_POST['name'];
				}
			
			if(empty($_POST['message'])) {
			echo '<p>' . $lang_admin['no_article_w'] . '</p>';
			
				}else{
				$message = $_POST['message'];
				}
			
			if($title && $name && $message) {
			$query = "INSERT INTO blog (title, author, post, date) VALUES ('$title', '$name', '$message', NOW())";
			$result = mysql_query($query);
			
			if($result) {
			echo '<p>' . $lang_admin['success_article'] . '</p>';
			
				}else{
				echo '<p>' . $lang_admin['couldnot_article'] . ' [ <a href="blog_posts_new.php">' . $lang_admin['back'] . '</a> ]</p>';
				}
			
			}else{
			echo '<p>' . $lang_admin['not_filled_all'] . '. [ <a href="blog_posts_new.php">' . $lang_admin['back'] . '</a> ]</p>';
			}
			}
			
			echo '<form action="" method="post">
			<p>&nbsp;</p>
			<p><input type="input" name="title" class="fields" size="30" maxlength="60"> <strong>' . $lang_admin['title'] . '</strong></p>
			<br>
			<p><input type="input" name="name" class="fields" size="30" maxlength="35"> <strong>' . $lang_admin['author'] . '</strong></p>
			<br>
			<p><strong>' . $lang_admin['w_article'] . '</strong><br>
			<textarea rows="7" cols="55" name="message" class="fields"></textarea></p>
			<br>
			<p><input type="submit" name="submit" class="button" value="' . $lang_admin['publish'] . '"></p>
			<input type="hidden" name="submitted" value="TRUE"></p>
			</form>';
		
			?></p>
			</div>
		</div></td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
			
	<div class="clear"></div>
		 
	</div>

	<div class="clear">&nbsp;</div>

</div>
<div class="clear">&nbsp;</div>
</div>
<?php include('files/footer.php'); ?>
Return current item: WH Community