
26.01.2009, 12:53
|
|
Участник форума
Регистрация: 11.05.2008
Сообщений: 202
С нами:
9473484
Репутация:
104
|
|
PHP код:
<?php
$const = array();
$const = array('L','C','SN','UN','REM','R','F','Fun','Conf');
$cont = count($const);
for($i=0 ; $i < $cont; $i++)
{
define($const[$i],true);
}
include_once 'config.php';
include_once "func/blog_func.php";
//
if(!isset($_REQUEST['id']) || empty($_REQUEST['id']))
{
$resul = defsell();
}
else{
$id = $_REQUEST['id'] ;
$id = (int)$id;
$resul = selpage($id);
//
//
}
//echo '<meta http-equiv="Refresh" content="0; URL=/less/blog/index.php"> ';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>
<link rel="stylesheet" href="tema.css" type="text/css" />
</head>
<body>
<div id="header"></div>
<div id="maincontent">
<table>
<tr>
<td id="left">
<div class="menu"><?php include_once "block/left.php" ?></div></td>
<td id="content">
<?php
if(isset($_REQUEST['page']))
{
$val = $_REQUEST['page'];
}
switch($val)
{
case "send_news":
include_once "block/send_news.php" ;
break;
case "update_news":
include_once "block/update_news.php" ;
break;
case "remove_news":
include_once "block/remove.php" ;
break;
default:
include_once "block/content.php" ;
}
?>
</td>
<td id="right">
<div><?php include_once "block/right.php"; ?></div></td>
</tr>
</table>
</div>
<div id ="footer"><?php include_once "block/footer.php"; ?> </div>
</body></html>
//файл с функц
<?php
function redict($red)
{
return header("Location: $red");
}
function update_page ($id,$idcat,$hide,$text,$title)
{
connect();
$q="update page set id_cat=$idcat, visible=$hide , content='$text',title='$title' where id=$id";
$at = mysql_query($q);
query_set($at);
redict('index.php');
}
?>
//update_news.php
<?php
if(!defined('UN')) die("Not Find") ;
if(isset($_REQUEST['update']))
{
$id = $_REQUEST['id'];
$id =(int)$id ;
$idcat = $_REQUEST['cat'];
$idcat =(int)$idcat;
$hide = secdb($_REQUEST['hide']);
$title = secdb($_REQUEST['title']);
$text = $_REQUEST['text'];
update_page($id,$idcat,$hide,$text,$title);
}
if(!isset($_REQUEST['update']) || empty($_REQUEST['update']))
{
//форма
}
?>
Кричит что header() уже послан
как все таки послать хедер
|
|
|