I am in the process of making a blog where I have admin and regular members. I want them to login and in the admin section be able to see there posts and be able to add a new post. I started it but nothing is working and I know Im probably way off but I need help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>The Wacky Wahinis: The Blog, a collective diary and blog of the wacky wahinis!</title>
<link rel="stylesheet" type="text/css" href="demo.css" media="screen" />
<script language="javascript" type="text/javascript" src="tinymce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
theme_advanced_buttons1 : "bold,italic,underline,link,unlink,bullist,numlist,outdent,indent,forecolor,fullscreen,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
});
</script>
</head>
<body>
<?php
include ('config.php');
@mysql_connect($db_host, $db_user, $db_password) or die('not connected');
// Select the database
$dbc = @mysql_select_db($db_name) or die ('no database selected');
session_start();
// Check if user is signed in
if($_SESSION['user_id'])
// Get user information
$sql = "SELECT usr FROM tz_members WHERE user_id = '{$_GET['user']}'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
// Get status messages for that user
$sql = "SELECT id, title, content FROM from blogData WHERE user_id = '{$_GET['user']}' ORDER BY statusdate DESC";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$posts[] = array(
'id' = $row['id'],
'title' = $row['title'],
'content' = $row['content']
);
}
if(isset($_POST['submit'])){
$title= $_POST['title'];
$category = $_POST['category'];
$content = $_POST['content'];
mysql_query("INSERT INTO blogData('title', 'category', 'content') VALUE('$title', '$category', '$content'");
}
?>
MOD EDIT: [noparse]
[/noparse] bbcode tags changed to [noparse]
..
[/noparse] bbcode tags. Please use these (more appropriate) tags in the future!