<?
include "manager_header.php";

if(!isset($_GET['w_id'])) { header("Location: index.php"); exit(); }
$w_id = $_GET['w_id'];
if(mysql_num_rows(mysql_query("SELECT w_id FROM bhost_weblogs WHERE w_id='$w_id' AND (u_id='$user_info[u_id]' OR level1 LIKE '%,$user_info[u_id],%' OR level2 LIKE '%,$user_info[u_id],%')")) != 1) { header("Location: index.php"); exit(); }

if($t == "settings") { 
 $location = "settings.php"; 
} elseif($t == "new") {
 $location = "add_entry.php";
} elseif($t == "post") {
 $location = "add_entry.php?t=post&up_id=$up_id";
} elseif($t == "podcast") {
 $location = "add_entry.php?t=pod&up_id=$up_id";
} else { 
 $location = "view_entries.php"; 
}
setcookie("w_id", "$w_id", 0, "/");
cheader($location);
exit();

?>