<?php
session_start();
if(strpos(strtolower($_SERVER['REQUEST_URI']), 'phpsessid') !== false)
{
  session_destroy();
  session_regenerate_id();
  session_start();
                              
}
include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";


$id     = $_GET['id'];
$ativo  = $_GET['ativo'];

if($ativo==1){

	$atv=0;

}else{

	$atv=1;

}



mysql_query("UPDATE campanhas SET ativo = '$atv' WHERE id='$id'", $con) or die(mysql_error());

  
header("location:index.php");