<?
ob_start();
require_once("../lib/func_ar.php");

$idd=$_GET['id'];
$sel = "select * from news where id='$idd'";
$query = mysql_query($sel);
    while($result = mysql_fetch_array($query)){
    extract($result);
        if($active != 1){
            //change active
            $result = "update news set active='1' where id='$idd'";
            $query = mysql_query($result);
            header('Location: edit_news.php');
        }else{
            //change active
            $result = "update news set active='0' where id='$idd'";
            $query = mysql_query($result);
            header('Location: edit_news.php');
        }
    }


/*
echo "<font color='green'><b>please white...</b></font><br /><img src='images/loading11.gif' />".
"<meta http-equiv='refresh' content='5'>";
header('Location: index.php');
*/


ob_flush();
?>